Note that there are some explanatory texts on larger screens.

plurals
  1. POajax causing fadeToggle to run multiple times
    primarykey
    data
    text
    <p>as the title says on my application there is a ajax .load function that is causing a fadeToggle to play up. </p> <p>The app works as follows:</p> <p>there is a jquery function that loads the "events" page:</p> <p>`</p> <pre><code>function LOAD_EVENTS_PAGE(d,m,y) { $('.show_page').load('events.php',function(){ scroll_bar=$('.cndr_sidebar_inner').jScrollPane({mouseWheelSpeed:30,autoReinitialise:true,maintainPosition:false,animateScroll:true}).data('jsp'); //RELOAD FORM INPUT CODE $(".form-field").length&amp;&amp;(wtextval=[],$(".form-field").each(function(a){var b=$(this).attr("id");if(""==b||null==b||void 0==b)b="form-field_"+a,$(this).attr("id","form-field_"+a);wtextval[b]=$(this).val();$(this).addClass("watermark");$(".form-field").css("color","#999")}),$(document).on("focus",".form-field",function(a){a=$(this).attr("id");$(this).val()==wtextval[a]&amp;&amp;($(this).val("").removeClass("watermark"),$(".form-field").css("color","#333"))}),$(document).on("blur",".form-field",function(a){a=$(this).attr("id");""==$(this).val()&amp;&amp;($(this).val(wtextval[a]).addClass("watermark"),$(".form-field").css("color","#999"))})); $(".cndr_but_2, #cancel_but_2, #accept_but_2").click(function() { var d = $('#date_holder').attr('value'); var m = $('#date_holder').attr('name'); var y = $('#date_holder').attr('alt'); $(".datepicker_popup_2").fadeToggle( "fast", "linear" ); var d = $('#date_holder').attr('value', d); var m = $('#date_holder').attr('name', m); var y = $('#date_holder').attr('alt', y); }); $('.event_date').attr('value',d+'-'+m+'-'+y); $('.show_header_date').text(GET_MONTH(m)+' '+y); $('.day_field_2').val(d); $('.month_field_2').val(m); $('.year_field_2').val(y); }); } </code></pre> <p>`</p> <p>the toggle part if you dont wanna keep searching through that code:</p> <p><code> $(".datepicker_popup_2").fadeToggle( "fast", "linear" ); </code></p> <p>Now, the problem is when the user uses the function more than ones, after a bit of playing around I found that it must be switching the toggle or adding on to it type of thing, I am just very confused by this, but basically the "fadeToggle" is on a full page pop up (basically a date picker type thing) and if i visit the events page a second time and click on the link which opens up the date picker, when i try to close it it fades out but then fades back in again......but, i found that if i open up the page a third time it fades out then fades back in , then...fades back out hence why i said it must be "adding onto" the toggle command????? </p> <p>so my questions are:</p> <p>1) what is causing this? 2) how can I fix this? 3) is there a css fade toggle i can use instead?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload