Note that there are some explanatory texts on larger screens.

plurals
  1. POload() + Lightbox doesn't work on IE 8 only
    primarykey
    data
    text
    <p>This time, it's a little bit different from my previous posts. So I decide to make a new one.</p> <p>FYI, I use Lightbox plugin from this: <a href="http://leandrovieira.com/projects/jquery/lightbox/" rel="nofollow">http://leandrovieira.com/projects/jquery/lightbox/</a></p> <p>ePC.html = contain an image with lightbox effect (work with IE, Chrome, Firefox).</p> <p>reviews.html = Home page. connect to scripts/script.js. (Contain the .load() function, loading ePhone.html or ePC.html by clicking on one of those 3 links). Please Ignore "ePhone.html". Below is the scripts/script.js file:</p> <pre><code>$(document).ready(function() { //ePhone link is clicked. Open ePhone.html PLEASE IGNORE THIS LINK. $('#linkEPhone').click(function() { $('#apDiv2').load('ePhone.html'); }); //ePC link is clicked. Open ePC.html $('#linkEPC').click(function() { $('#apDiv2').load('ePC.html', function () { $('a[@rel*=lightbox]').lightBox(); }); }); //ePC2 link is clicked. Open the &lt;div&gt; section of ePC.html. The image is located inside the &lt;div&gt; section. $('#linkEPC2').click(function() { $('#apDiv2').load('ePC.html #content', function () { $("head").append($("&lt;link rel='stylesheet' href='css/jquery.lightbox-0.5.css' type='text/css' media='screen' /&gt;")); $.getScript('js/jquery.js', function() { $.getScript('js/jquery.lightbox-0.5.js', function() { $('a[@rel*=lightbox]').lightBox(); }); }); }); }); }); </code></pre> <p><strong>The problem is with the third one above:</strong> $('#apDiv2').load('ePC.html #content', function () {...</p> <p>'#content is id. ANd the picture is within the tag within "ePC.html"</p> <pre><code>&lt;div id=content&gt; &lt;a rel="lightbox" href="images/bird.jpg"&gt;&lt;img src="images/bird_s.jpg" width="72" height="72" alt="" /&gt;&lt;/a&gt; &lt;/div&gt; </code></pre> <p>It WORKS 100% on Chorme and Firefox but <strong>NOT Internet explorer 8</strong>!!!!. (I understand why people hate IE now..) IE crashed!. I later fixed this crashing problem by removing the !DOCTYPE..within "reviews.html" Ok with !DOCTYPE removed, IE doesn't crashed anymore. HOWEVER, the lightbox CSS DOES NOT APPLIED to the image! </p> <p><strong>Other methods that I have tried but didn't work:</strong> *<em>1. "live" instead of "load":</em>*</p> <pre><code>$('#linkEPC2').click(function() { $('#apDiv2').live('load', 'ePC.html, #content', function(){ $("head").append($("&lt;link rel='stylesheet' href='css/jquery.lightbox-0.5.css' type='text/css' media='screen' /&gt;")); $.getScript('js/jquery.js', function() { $.getScript('js/jquery.lightbox-0.5.js', function() { $('a[@rel*=lightbox]').lightBox(); }); }); }); }); </code></pre> <p>This one doesn't work at all. Even the image is not there at all. So I guess I may stick with the "load()" function instead.</p> <p><strong>2. I've also tried putting these 3 lines into the div section:</strong></p> <pre><code>&lt;div id=content&gt; &lt;link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.5.css" media="screen" /&gt; &lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery.lightbox-0.5.js"&gt;&lt;/script&gt; &lt;a rel="lightbox" href="images/bird.jpg"&gt;&lt;img src="images/bird_s.jpg" width="72" height="72" alt="" /&gt;&lt;/a&gt; &lt;/div&gt; </code></pre> <p>but it doesn't work neither..</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.
 

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