Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

image preloader script conflicting with lightbox script

Featured Replies

Hi I have a project: http://studioaura.com/woodpeckerwindows/case-studies-carshalton-surrey.html

 

It requires (a) an image preloader for the main image on the right to fade-in smoothly and also (B) the standard lightbox script loading from the gallery image at the bottom left. The trouble is at the moment I can only have one or the other. Does anyone know why? I have fixed something similar before by changing the $ sign in the jquery script to 'jQuery'. However this is already present. Are there are any Javascript experts that could offer some advice as to how to get both scripts working?

 

Cheers, Sam.

are you using the Lightbox? I couldn't see it being used on the site.

 

have you tried another. I gave up on the standard one long ago as it kept conflicting with things. Now favour colorbox.

 

There are a whole heap of them out there though http://planetozh.com/projects/lightbox-clones/

  • Author

Thanks for the reply, I was using the lightbox but I too have had issues with it before. Colorbox looks very interesting and I am going to give it a try! Many thanks. Sam

  • Author

I had a look and it seemed interesting, however, the client wants the original lightbox and there is a conflict between the prototype.js file and the jquery library. Does anyone know a solution to this? I've searched everywhere but nothing anyone has offered has stopped this conflict. Basically I want to use the standard lightbox and also this image preloader:

 

JS:

 

<script>

function turnoffpreloader() {

var preloader = document.getElementById("product_preloader");

var mainimage = document.getElementById("main_product_shot");

preloader.style.display = "none";

//mainimage.style.display = "block";

jQuery("#main_product_shot").fadeIn('slow', function() {

//alert("testing");

});

}

</script>

 

HTML:

 

<span id="product_preloader" style="display:block;position:absolute;top:280px;left:50%;margin-left:-10px;"></span>

<img src="images/home.jpg" alt="" title="" onload="turnoffpreloader()" id='main_product_shot' style='display:none;' />

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.