Results 1 to 7 of 7

Thread: sagscroller conflict with lightbox...how do I fix?

  1. #1
    Join Date
    Jun 2011
    Location
    Netherlands
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy sagscroller conflict with lightbox...how do I fix?

    1) Script Title:
    sagscroller (automatic scroller): http://www.dynamicdrive.com/dynamici...agscroller.htm
    Lightbox2:http://www.huddletogether.com/projects/lightbox2/
    Updated to 2.04 as was recomended on this forum.
    (http://home.comcast.net/~jscheuer1/s...htbox2.04a.zip )
    2) Script URL (on DD): see above

    3) Describe problem:

    I'm at my wits and with this (been searching and trying out for 2 days now to get all 3 working)

    I first had the problem of the lightbox fade fading everything but css menu and sagscroller. Finally got that to work (z-index of lightbox and overlay both need to be 1000 -ish)...was in a cheering mood when I saw my sagscroller didnt scroll....

    So...I decided to look here for the answers and saw some good tips so tried them (other versions of lightbox and other apps like lightbox such as slimbox) But it didnt give any solution...sadly....or I did something wrong...

    ( http://www.dynamicdrive.com/forums/s...70&postcount=1 )

    I saw a bit of code to be replaced by another code in tje lightbox.js file so there is no onload conflict and I think that could well be the problem.
    But I seem to not have the particular code in the .js file which needs to be replaced and as I am by no means up to speed on js I really do not know what piece of my .js file to replace it with.
    Ofcourse now that I want to add that piece of coding to let you know what I meen I can't find it anymore.. It was posted by jscheuer1

    Could someone please help me cause this has been taken up almost 2 days of searching now.. And thats time I really dont have atm.
    I like being on the internet but this is getting absurd

    All is working fine...till I put them in to one page.
    If I place the sagscroller header code at the bottom of the header the sagscroller works but the lightbox is not (images open in a new page)
    If I place the lightbox header code on the bottom of the header the lightbox works but the sagscroller stops scrolling (but is showing the first 3 images loaded from a textfile...)

    Think they are both having a go with the onload but how to fix this....

    Thanks in advance from a very tired me.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Slimbox 2.04 would be a good fit for this. Make sure to install it correctly and get rid of all of the lightbox files. If items in the scroller are lightbox links, you may need different code to replace the "AUTOLOAD CODE BLOCK" of Slimbox, like:

    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);
    And should use only one copy of jQuery for the page. Version 1.52 would be good.

    Considering your post, this may be a bit much to take in at once. If you have a page up somewhere or can put one up, it doesn't have to work - just give a good idea of what you're going for, post a link to it and I'll see what can be done with it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    WvS (06-23-2011)

  4. #3
    Join Date
    Jun 2011
    Location
    Netherlands
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    THANKS!!!

    You know what...I think I was just to tired yesterday cause today I looked at my files again to install the slimbox2 you suggested and ...what a mess I had made of things!
    I think I have been going at it way to long yesterday to see what I was doing in the end.
    Anyway, I did what you said I should......it worked!

    One thing I just need to ask even tho things are working now.
    My menu uses jquery version 1.4.2 and the lightbox version 1.4

    Should I still change them both to 1.52? Or best keep it like this ("why fix something if it aint broken")
    And if I should change...can I just change the numbers in the source code or... (almost sounds to easy!)

    Ok i'm off to install the slimbox2 to all 7 galleries!

    Thanks again!

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not sure what you mean by:

    My menu uses jquery version 1.4.2 and the lightbox version 1.4
    If you mean Slimbox uses 1.4, then yes. I tell you what, make a backup of the page just in case. Change the first instance of jQuery on the page to:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
    Get rid of any other jQuery external script tags. But you didn't say which menu script you were using. If it has this in it:

    Code:
    jQuery.noConflict()
    That might need to be removed.

    I could be more specific if I had a link to the page. Try it. If it works it will be more efficient and more future proof. If not - you have your backup and you can give me a link to the non-working version for troubleshooting.
    Last edited by jscheuer1; 06-23-2011 at 01:31 PM. Reason: add bold
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #5
    Join Date
    Jun 2011
    Location
    Netherlands
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Sorry it took me a bit to get back here.

    I tried changing the version to 1.5.2 and the sagscroller was the first with jquery so he was the lucky one to have his version changed.
    Oh btw it was the sagscroller that uses 1.4.2 not the menu (sorry!)
    Now my sagscroller did not like this change one bit and doesnt do anything anymore. But my slimbox is all fine with the change.
    I sorta expected this to be the other way around
    the noconflict..I couldnt find it in the sagscroller. Or did I need to find it in the slimbox now that its the slimbox whos external link I deleted?

    uploaded the testpage here

    Slimbox already used 1.5.2

    thanks again!
    Last edited by WvS; 06-29-2011 at 07:38 AM. Reason: ...well to ad something!

  7. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There could also be other problems but all of the images in sparkadoodle.nl/jquery version/sagcontent.txt are 404 Not Found.

    Fix that and see what happens. There doesn't appear to be any script error. None of the scripts are using jQuery.noConflict(), and the menu doesn't appear to even be a script, just css.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #7
    Join Date
    Jun 2011
    Location
    Netherlands
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Oh stupid me forgot to load the content to the server

    And I loaded them and the scroller worked...argh.
    It didnt work local as it did before the version change so I asumed...theres where I went wrong!
    Ok you can slap me around with a big book of jquery now...

    sorry for the waste of time and thanks for the patients!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •