1

I'm running some code to add products to a shopping cart. As I'm are simulating the product increment I'll have to give the page about 1000ms to acctually process the request to increment and add the product to the cart.

There are times when the customized form ends up in 10 or more products.

I have tried to hide everything beneath a gray div that has a high opacity, I cant use blockui since I'm running jquery 1.3 and that's in the framework I have to build upon.

This is what I do. Why is it not working? I can't see the div at all?

startLoad();
pdel = 1000;
$("input:submit[value='handla']").each(function(index)

   if(index != 1)
   {

      $("#backgroundPopup").text("Lägger produkt" + index + " i varukorgen");
      var submithing = this;  
      setTimeout(function(){ clicksubmitbutton(submithing); },pdel);
       pdel += 1000;
   }                      
});  

stopLoad();

 function startLoad(){
 $("#backgroundPopup").css("opacity", "0.7"); // css opacity, supports IE7, IE8

 $("#backgroundPopup").show();
 }
 function stopLoad()
 {
  $("#backgroundPopup").hide();
 }

CSS

#backgroundPopup {
z-index:1;
position: fixed;
display:none;
height:100%;
width:100%;
background:#000000;
top:0px;
left:0px;
}
4

1 回答 1

0

把你的stopLoad函数放在 DOM onReady 中。使用 jQuery,您可以这样做:

$(document).ready(function() {
    stopLoad();
});
于 2013-03-31T23:10:18.110 回答