Search Results

Search found 11 results on 1 pages for 'phonethics'.

Page 1/1 | 1 

  • Prototype Multi-Event Observation for Multi-Elements

    - by Phonethics
    ['element1','element2','element3'].each(function(e){ Event.observe(e, 'click', function(event){ ... }); Event.observe(e, 'blur', function(event){ ... }); Event.observe(e, 'mousedown', function(event){ ... }); Event.observe(e, 'mouseover', function(event){ ... }); }); Is there a way to reduce this so that I can do ['element1','element2','element3'].each(function(e){ Event.observe(e, ev, function(event){ switch(e){ switch (ev) } }); }); ?

    Read the article

  • FireFox Specific CSS

    - by Phonethics
    background-color:transparent doesnt work on SELECTs in browsers other than FireFox. So how I specify background-color:transparent for FF alone and background-color:#something for others ?

    Read the article

  • Not allowing next jqueryui.show() animation to start without finishing previous one

    - by Phonethics
    Im using jquery &jquery UI. $.each(data, function(count,item) { showItem(item); // Dont continue without showItem finishing }); function showItem(item) { $('#div-container').prepend(renderItem(item)); $("#div-container div.block:first").show('blind',{},500,function(){}); } Works, but when there are 3 items in data, it animates all 3 in one go. I need this done one-by-one. How do I tell .show() to execute the next show() after the previous one is completed ? Or do I specify this in each() ?

    Read the article

  • Calling a Function Based on a String Which Contains the Function Name

    - by Phonethics
    var foo1,foo2; switch (fn) { case "fade" : foo1 = "fadeOut"; foo2 = "fadeIn"; break; case "slide" : foo1 = "slideUp"; foo2 = "slideDown"; break; } eval("$('.cls1')." + foo1 + "();"); currentSlideIndex = currentSlideIndex + n; eval("$('.cls1')." + foo2 + "();"); Any better way to achieve this without using eval ? Im not a very big fan of using eval unless absolutely necessary.

    Read the article

  • PDO:sqlite doesnt INSERT data, yet no error

    - by Phonethics
    try { $res = $db-exec($sql); if ($res === FALSE) { print_r($db-errorInfo()); die(); } } catch(PDOException $e) { die($e-getCode().':'.$e-getMessage()); } catch(Exception $e) { die($e-getCode().':'.$e-getMessage()); } No error info, and neither does it get caught as an exception. Yet $res is FALSE and no data gets inserted. Array ( [0] => ) But when I echo $sql and enter that query in SQLiteManager, it works inserting the data.

    Read the article

  • Arguments to JavaScript Anonymous Function

    - by Phonethics
    for (var i = 0; i < somearray.length; i++) { myclass.foo({'arg1':somearray[i][0]}, function() { console.log(somearray[i][0]); }); } How do I pass somearray or one of its indexes into the anonymous function ? somearray is already in the global scope, but I still get somearray[i] is undefined

    Read the article

  • Accessing an Internal Function in setInterval

    - by Phonethics
    (function($) { $.fn.myPlugin = function(options) { var _this; var timer1; var foo = function(n) { if (timer1 != null) return; // in action timer1 = setInterval("bar("+n+")", 500); }; var bar = function(n) { ... if ( ... ) clearInterval(timer1); }; return this.each(function() { _this = $(this); _this.bind("click", function(){ foo(10); }); }); } })(jQuery); This doesn't work because "bar is not defined."

    Read the article

1