I guess that was sort of a weak "yes" on the comments and tips.
The reason I didn't include them in my first post is that I knew the changes in it would work and didn't want to complicate things.
Before you do any of these things, make a backup copy of your page.
After doing each one, test to make sure things are working, and make another backup copy before going to the next thing.
The first is I noticed that if you use the next and previous buttons on the lightbox, there are duplicates. Two extra Assassin's Creed Revelations Logo images (images/thumbs/assassins-creed-revelations1.jpg) and two extra Assassin's Creed Revelations: Multiplayer 2 images (images/assassins_creed/acr/acr_12.jpg)
They are not hard coded in the page. Something, I haven't figured out what, creates them. They seem to be useful in a way though - allowing the user to click on descriptions and see the larger image associated with those descriptions. So I see no need to get rid of them. But it would be nice to get them out of the train of next/previous once the user is looking at the Lightbox images.
To do so, open up slimbox2.js with a text only editor like Notepad. Make sure word wrap is off. You will see some info, a long line that is the main script, and this:
Code:
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
jQuery(function($) {
$("a[rel^='lightbox']").slimbox({/* Put custom options here */}, null, function(el) {
return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
});
});
}
Get rid of that part and replace it with this:
Code:
// Live invocation for use with other scripts, image maps, AJAX, etc. - also skips duplicates when forming groups
// Uses the rev attribute of the tag for a caption, freeing up the title for other uses or to be blank.
// Remove the AUTOLOAD CODE BLOCK if using this, or replace it with this code.
// Live Load Script (c)2011 John Davenport Scheuer - for use with Slimbox 2.04
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
(function($){
if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
$('*[href][rel^=lightbox]').live('click', function(e){
var t = this, rel = t.getAttribute('rel'), hrefs = [], links = [], index;
if(rel === 'lightbox'){
$.slimbox(t.href, t.getAttribute('rev') || '', { /* Options */ });
} else {
$('*[href][rel="' + rel + '"]').each(function(){
if($.inArray(this.href, hrefs) < 0){
if(t.href === this.href){index = hrefs.length;}
hrefs.push(this.href);
links.push([this.href, this.getAttribute('rev') || '']);
}
});
$.slimbox(links, index, {loop: true /* , Aditional Options */ });
}
e.preventDefault();
});
}
})(jQuery);
Save it. Use it instead of the one you're currently using.
This will require you to change all (14 when I looked at the page) of your:
Code:
rel="lightbox[acr]" title
like in:
Code:
<a href="images/ACS.png" rel="lightbox[acr]" title="Assassin's Creed Series">
to:
Code:
rel="lightbox[acr]" rev
like:
Code:
<a href="images/ACS.png" rel="lightbox[acr]" rev="Assassin's Creed Series">
Back up the file first. In your text only editor you can just do a global search and replace on:
Code:
rel="lightbox[acr]" title
to:
Code:
rel="lightbox[acr]" rev
That's the end of the first thing. Test it and see if it works before continuing.
The second is there are two versions of swfobject:
games.cs-uno.net/js/swfobject/swfobject.js
and:
games.cs-uno.net/swfobject.js
that are brought in externally to the page by:
Code:
<script type="text/javascript" src="js/swfobject/swfobject.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
It looks like you're only using the first one, so try getting rid of the second one, make sure everything still works with your video. You can always put the second one back if there's a problem.
The third thing is byte load and dimension size on the images. The page takes a long time to load even on a fast connection because so many of the images (both background and foreground) are so huge. Try resizing down the larger foreground ones, and optimizing all of them.
That's it. Or at least those are the main things I noticed.
Bookmarks