Posts

jquery - how to animate from left to right? -

demo : animates right left movement.but need use animation left right . basically, i'm using script: var counter = 1; var thisw = $('.btn.close').parent().outerwidth(); var thish = $('.btn.close').parent().outerheight(); $('.btn.close').on('click',function(){ counter = !counter; if(counter){ $(this).parent().animate({width: '5em', height: '2em'},1000); } else{ $(this).parent().animate({width: thisw, height: thish}, 1000); } }).click();//click trigger added because on first click doesn't animate //the reason is not getting actual width , height value set in em jquery px value. i think script can written better using ternary operator. i'm stacked on this. question: so what's better way write jquery of above code? is possible animate left right without using position absolute? use this: ...

android - popup dismiss on touch outside of popup -

i have 2 layouts 1 layout 80% of screen , other 20% of screen(lanscape mode), on 20% of screen layout have few buttons vertically.on click of each button popup window come on 80% screen layout,on touch outside popup window, popup window dismiss. problem on touch 80%screen popup should dismiss not on 20% screen. ref_channel.setonclicklistener(new onclicklistener() { @suppresswarnings("deprecation") public void onclick(view v) { display display = getwindowmanager().getdefaultdisplay(); point size = new point(); display.getsize(size); width_device = size.x; x = (width_device - ref_channel.getwidth()); layoutinflater = (layoutinflater) getbasecontext() .getsystemservice(layout_inflater_service); popupview = layoutinflater.inflate(r.layout.refchannel_popup, null); popu...

Ideal Replication Filter for JSON based Databases Like Couchbase, CouchbaseLite, CouchDB, etc.? -

i write filter function on couchdb server side to filter documents specific user . filter allow replication few selected documents particular user has access rather whole database of tbs of size. here found similar question couchdb: restricting users replicating own documents not provide me info need. so questions remain: what can best approach specify such filter? how should write such filter function, written example? what should include in every doc filter work way: in context of social network, suppose want fetch user data pictures server, in case document containing pictures holding userid in it. can case when friends of person visit profile , able view photos. in case whenever friend visits profile picture doc replicated friend , able view pictures also. how can accomplish such filter? more info : on mobile platform side using couchbaselite , on server side using couchdb. want filtered documents on mobile platform. a couchdb filter function has acc...

javascript - How to set a value of hyperlink text from a hyperlink to a hidden field on a jQuery dialog pop-up when user clicks on that hyperlink? -

i'm using php, smarty, jquery(jquery-1.7.1.min.js), javascript, ajax, etc. in website. there multiple hyperlinks containing different question ids present on webpage. instance i'm showing html code 1 hyperlink follows: <a class="que_issue" href="#">que38552</a> <!--there many other hyperlinks present on same page different question ids.--> now i've html code dialog pop-up on same web page set style="display:none;" in div when page loads. done hide dialog box when page loads. when user clicks on of hyperlinks dialog pop-up appears. script functionality working fine. html of dialog pop-up follows: <div id="searchpopcontent" class="c-popup" style="display:none;"> <div id="pop-up"> <div class="error_msg" id="report_error" style="text-align:center; margin-top:5px;"> </div> <div class="clear"></di...

go - Traversing nested JSON structs -

i want traverse nested json struct , each key , value interface{} http://play.golang.org/p/b-b3pejgjw so want following struct { "tg": { "a": { "e": 100, "h": 14 }, "b": { "d": 1 }, "c": { "d": 1, "e": 1 }, "d": { "f": 1, "g": 1, "h": 1 }, "e": { "g": 1 } } } i able following a := js.get("tg").get("d").get("f") fmt.println(*a) // {1} but having trouble type assert integer. invalid type assertion: (*a).(int) how would traverse whole struct , each integer mapped characters? thanks! your value ...

Javascript: window.saveAs in android Webview -

i using code save client-generated png files: my_canvas.toblob (function (blob) {window.saveas (blob, my_filename)}, 'image/png') i'm using these cross-browser compatibility: javascript canvas blob 2.0.5 sebastian tschan, https://github.com/blueimp/javascript-canvas-to-blob . filesaver.js eli grey, http://eligrey.com . works in ie10+, chrome, firefox, chrome android, breaks down in base web view engine in 4.3. since i'm trying lightly use phonegap here , make compatible non-new current devices mobile, need work in android webview 4.3, @ least. q & a: q: how break down? a: sends me non-existent url instead of making image , opening it. i've had many problems canvas, blobs , old versions of android. on version have use blobbuilder, on others webkitblobbuilder (on versions blobbuilder there not correctly implemented), canvas.todataurl not present before android 3 , not work correctly before 4.x... for reasons used canvas2imageplugi...

php - getting data from database as a json response -

here trying data database , want display json response user can fetch each field. here how user can perform query http://localhost/safari/index.php?getbranch=true this should give branch details tables. here php code it <?php if(isset($_get['getbranch'])) { $getbranch = $_get['getbranch']; if($getbranch == 'true') { getbranch($getbranch); } } function getbranch($getbranch) { $con = mysqli_connect('127.0.0.1', 'root', '', 'safari'); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); return; } $today = date("ymd"); $result = mysqli_query($con,"select division, branch,branchofficename,branchofficecode,status tbl_branchoffice"); while ($row = @mysqli_fetch_array($result)) { $res...