Flash of Un-styled Content using Malsup Cycle?

Flash of Un-styled Content using Malsup Cycle?

Hi

I'm working on a website and using the cycle plug in to display manufacturers logos. The site also includes a carousel plugin on a different part of the page.

My problem is that all the slideshow images appear for a second when the page is opened on an iPhone & iPad (works fine on PC & android). I've tried the suggestions on this website & malsup's faq and it doesn't fix the prooblem, the only way I get it to work correctly is to remove the Carousel script that succeeds it.

I'm not sure how to fix the problem, and my jQuery skill is not best. Any help would be greatly  appreciated 

  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <!-- TemplateBeginEditable name="doctitle" -->
  7. <title>GDS Henley</title>
  8. <!-- TemplateEndEditable -->
  9. <style type="text/css"> 
  10. body {
  11. background-image: url(../images/banners/bgGrad.gif);
  12. background-repeat: repeat-x;
  13. background-color: #777A7A;
  14. }

  15.       .example-desc {
  16.         margin:3px 0;
  17.         padding:5px;
  18.       }

  19.       #carousel {
  20.         width:632px;
  21.         height:550px;
  22.         position:relative;
  23.         clear:both;
  24.         overflow:hidden;
  25.       }
  26.  
  27.       #carousel img {
  28.         visibility:hidden; /* hide images until carousel can handle them */
  29.        
  30.       }

  31.       .split-left {
  32.         width:450px;
  33.         float:left;
  34.       }
  35.  
  36.       .split-right {
  37.         width:400px;
  38.         float:left;
  39.         margin-left:10px;
  40.       }
  41.  
  42.       #callback-output {
  43.         height:250px;
  44.         overflow:scroll;
  45.       }
  46.  
  47.       textarea#newoptions {
  48.         width:430px;
  49.       }
  50.  
  51.  #wrapper {
  52.     width: 800px; /* 780px is just wide enough to fill and 800px screen */
  53.     margin: 0 auto; /* It's important to set the margin to auto if you want the layout to center */
  54.     text-align: middle;
  55. }

  56. #wrapper2 {
  57.     width: 800px; /* 780px is just wide enough to fill and 800px screen */
  58.     margin: 0 auto; /* It's important to set the margin to auto if you want the layout to center */
  59.     text-align: middle;
  60. }

  61. #body1 {
  62. width: 632px;
  63. margin: 0;
  64. text-align: left;
  65. float:left;
  66. }

  67. #body2 {
  68. width: 148px;
  69. margin: 0;
  70. text-align: left;
  71. float:right;
  72. margin-top:0px;
  73. margin-left:0px; 
  74. }

  75. .headingText {
  76. font: Verdana, Geneva, sans-serif;
  77. font-size:25px;
  78. text-align:left;
  79. color:#FFFFFF;
  80. }

  81. .mainText {
  82. font: Verdana, Geneva, sans-serif;
  83. font-size:15px;
  84. text-align:left;
  85. color:#FFFFFF;
  86. }
  87. </style>

  88. <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>

  89. <script src="http://malsup.github.com/jquery.cycle2.js"></script>

  90. <script type="text/javascript">

  91. function MM_swapImgRestore() { //v3.0
  92.   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  93. }
  94. function MM_preloadImages() { //v3.0
  95.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  96.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  97.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  98. }

  99. function MM_findObj(n, d) { //v4.01
  100.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  101.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  102.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  103.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  104.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  105. }

  106. function MM_swapImage() { //v3.0
  107.   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  108.    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  109. }
  110. </script>

  111.     <script type="text/javascript" src="../JS/jquery.waterwheelCarousel.js"></script>
  112.     <script type="text/javascript">
  113.       $(document).ready(function () {
  114.         var carousel = $("#carousel").waterwheelCarousel({
  115.           flankingItems: 0,
  116.  opacityMultiplier: 2,
  117.  imageNav: true,
  118.           movingToCenter: function ($item) {
  119.             $('#callback-output').prepend('movingToCenter: ' + $item.attr('id') + '<br/>');
  120.           },
  121.           movedToCenter: function ($item) {
  122.             $('#callback-output').prepend('movedToCenter: ' + $item.attr('id') + '<br/>');
  123.           },
  124.           movingFromCenter: function ($item) {
  125.             $('#callback-output').prepend('movingFromCenter: ' + $item.attr('id') + '<br/>');
  126.           },
  127.           movedFromCenter: function ($item) {
  128.             $('#callback-output').prepend('movedFromCenter: ' + $item.attr('id') + '<br/>');
  129.           },
  130.           clickedCenter: function ($item) {
  131.             $('#callback-output').prepend('clickedCenter: ' + $item.attr('id') + '<br/>');
  132.           }
  133.         });
  134. $("#waterwheel-carousel").waterwheelCarousel({
  135.   clickedCenter: function($clickedItem) {
  136.     // obtain the image src of the clicked center item
  137.     var clickedImageSrc = $clickedItem.attr("src");
  138.     // build a new image HTML image element, and fill in the src
  139.     $.facebox({ image: clickedImageSrc });
  140.   }
  141. });

  142.         $('#prev').bind('click', function () {
  143.           carousel.prev();
  144.           return false
  145.         });

  146.         $('#next').bind('click', function () {
  147.           carousel.next();
  148.           return false;
  149.         });

  150.         $('#reload').bind('click', function () {
  151.           newOptions = eval("(" + $('#newoptions').val() + ")");
  152.           carousel.reload(newOptions);
  153.           return false;
  154.         });

  155.       });
  156.     </script>

  157. <!-- include Cycle plugin -->

  158. >

  159. <link href="../JS/defunkt-facebox-cbe32e1/examples/css/example.css" media="screen" rel="stylesheet" type="text/css"/>
  160.  <link href="../JS/defunkt-facebox-cbe32e1/src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
  161. <script src="../JS/defunkt-facebox-cbe32e1/src/facebox.js" type="text/javascript"></script> 
  162.  
  163.   <script type="text/javascript">
  164.     jQuery(document).ready(function($) {
  165.       $('a[rel*=facebox]').facebox({
  166.         loadingImage : 'http://www.gdshenley.com/JS/defunkt-facebox-cbe32e1/src/loading.gif',
  167.         closeImage   : 'http://www.gdshenley.com/JS/defunkt-facebox-cbe32e1/src/closelabel.png'
  168.       })
  169.     })
  170.   </script>

  171. <!-- TemplateBeginEditable name="head" -->
  172. <!-- TemplateEndEditable -->
  173. <link href="../styles.css" rel="stylesheet" type="text/css" />
  174. </head>

  175. <body onload="MM_preloadImages('../images/buttons/homePage/homeOn.png','../images/buttons/homePage/pricesOn.png','../images/buttons/homePage/contactOn.png','../images/products/pro1_On.gif','../images/products/pro2_On.gif','../images/products/pro3_On.gif','../images/products/pro6_On.gif','../images/buttons/homePage/pricesOff.png','../images/buttons/homePage/contactOff.png','../images/buttons/homePage/homeOff.png','../images/buttons/homePage/productsOff.png','../images/buttons/homePage/productsOn.png','../images/logos/logo.gif','../images/banners/bgGrad.gif','../images/products/pro7_On.gif','../images/products/pro4_On.gif','../images/banners/name.gif','../images/banners/bgGrad.gif','../images/banners/line1.png','../images/banners/line2.png','../images/banners/line3.png','../images/logos/garadorLogo_1.png','../images/logos/hormannLogo_1.png','../images/logos/swsLogo_1.png')"> 
  176.  
  177. <div id="wrapper">

  178. <div align="center"> 

  179. <div align="left">

  180. <img src="../images/logos/logo.png" width="138" height="138" /><img src="../images/banners/name.gif" width="662" height="138" /></div>

  181. <div align="right"><img src="../images/banners/line1.png" width="800" height="5" /></div></div>

  182. <div align="right">
  183. <a href="../index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('homeImage','','../images/buttons/homePage/homeOn.png',1)"><img src="../images/buttons/homePage/homeOff.png" name="homeImage" width="127" height="49" border="0" id="homeImage" /></a>

  184. <a href="../GDSProducts.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','../images/buttons/homePage/productsOn.png',0)"><img src="../images/buttons/homePage/productsOff.png" name="Image5" width="127" height="49" border="0" id="Image5" /></a>

  185. <a href="../GDSPrices.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('pricesImage','','../images/buttons/homePage/pricesOn.png',1)"><img src="../images/buttons/homePage/pricesOff.png" name="pricesImage" width="127" height="49" border="0" id="pricesImage" /></a>

  186. <a href="../GDSContact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contactImage','','../images/buttons/homePage/contactOn.png',1)"><img src="../images/buttons/homePage/contactOff.png" name="contactImage" width="140" height="49" border="0" id="contactImage" /></a>

  187. </div>

  188. <div align="center">

  189. </div>

  190. </div>


  191. <div id="wrapper2">
  192. <div id="body1" align="left">
  193.   <img src="../images/banners/line3.png" width="632" height="5" />
  194. <!-- TemplateBeginEditable name="titleRegion1" --><!-- TemplateEndEditable --><img src="../images/banners/line2.png" width="632" height="5" />
  195. <!-- TemplateBeginEditable name="mainText1" -->
  196. <p class="mainText">&nbsp;</p><!-- TemplateEndEditable --></div>

  197. <div id="body2" align="right">

  198. <div class="cycle-slideshow"
  199. data-cycle-speed="300"
  200. data-cycle-loader="wait"
  201.         data-cycle-timeout="2000"
  202.         data-cycle-random="true">
  203.        
  204.     <img src="../images/logos/garadorLogo_1.png">
  205.     <img src="../images/logos/hormannLogo_1.png">
  206.     <img src="../images/logos/swsLogo_1.png">
  207. </div>
  208. </ br>

  209. </div></div></div></div>
  210. </body>
  211. </html>
    • Topic Participants

    • matt