javascript - jQuery - trigger function is making my page to reload without stop -
<script type="text/javascript"> $.noconflict(); jquery(document).ready(function($){ $("#superwebf1").click(function(){ event.stopimmediatepropagation(); }); $("#superwebf1").click(function(){ if ($('[name="shipping_method"]', window.parent.document).is(':checked')){ event.stoppropagation(); billing.save(); parent.jquery("#loadingdiv").show().delay(4300).fadeout(); parent.jquery("#outdiv").hide().delay(5000).fadein(); parent.jquery('#outdiv').removeclass('outerdiv'); parent.jquery('#outdiv').removeclass('outerdivnoadress'); settimeout(function() { if( $('#displayme').length ){ parent.jquery('#outdiv').addclass('outerdiv1000'); } else { parent.jquery('#outdiv').addclass('outerdiv1000no'); } }, 5100); parent.jquery('#inneriframe').removeclass('framecss'); parent.jquery('#inneriframe').removeclass('framecssnoadress'); parent.jquery('#inneriframe').addclass('framecss1000'); }else { alert('Моля, изберете начин на доставка!'); } }) $('#superwebf1').trigger( "click" ); }); </script>
with code i'm making button id superwebf1
clicked @ load of page.
the problem script page not stopping reload.
can somehow make stop reloading time ?
thanks
add type="button" button tag
var billing = {save: function(){}}; $.noconflict(); jquery(document).ready(function($){ var superwebf1 = $("#superwebf1"); superwebf1.click(function(){ event.stopimmediatepropagation(); }); superwebf1.click(function(){ if ($('[name="shipping_method"]', window.parent.document).is(':checked')){ console.log("here"); event.stoppropagation(); billing.save(); parent.jquery("#loadingdiv").show().delay(4300).fadeout(); parent.jquery("#outdiv").hide().delay(5000).fadein(); parent.jquery('#outdiv').removeclass('outerdiv'); parent.jquery('#outdiv').removeclass('outerdivnoadress'); settimeout(function() { if( $('#displayme').length ){ parent.jquery('#outdiv').addclass('outerdiv1000'); } else { parent.jquery('#outdiv').addclass('outerdiv1000no'); } }, 5100); parent.jquery('#inneriframe').removeclass('framecss'); parent.jquery('#inneriframe').removeclass('framecssnoadress'); parent.jquery('#inneriframe').addclass('framecss1000'); }else { alert('Моля, изберете начин на доставка!'); } }); superwebf1.trigger( "click" ); }); </script> <form> <input name="shipping_method" type="checkbox" checked><button type="button" id="superwebf1">test</button> </form>
Comments
Post a Comment