Page 4 of 4 FirstFirst ... 234
Results 31 to 35 of 35

Thread: Ajax + lightbox

  1. #31
    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

    Quote Originally Posted by willymonster
    hi John,

    after reading the development thread, i still can't figure out how to resolve the problem. when i click on an link to an image, it still shows up on a new page. i cant get lightbox to work on it. is there some changes that i need to make on it?

    thanks,
    I'm confused. What did you read and what did you do? To sort it out with any hope of certainty, I would need a link to your pages that are having the problem.
    - John
    ________________________

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

  2. #32
    Join Date
    Sep 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax + lightbox

    hi John,

    sorry for the confusion. here's what i am having problems with. ajax menu bar + lightbox. on the site, www.66mott.com - when you click on gallery and click any of the image links, instead on initiating the lightbox feature, it loads the picture on a new page. i noticed that the lightbox feature only works on the index page, maybe because of the ajax menu bar i am using.

    here is an example of 2 links on how it looks like on my index.php page:

    ('../menufolder/gallery.html', 'contentarea');">Gallery</a></li>
    <li><a href="javascript:ajaxpage[/COLOR]('../menufolder/press.html', 'contentarea');">Press Review</a></li>


    i created a gallery.html page to put the lightbox feature in it, but when i click it, it opens the picture on a new page WITHOUT activating the lightbox feature.



    here is what the information i have on my gallery.html page.

    <script type="text/javascript">
    function pollContent(id){
    if(document.getElementById(id)){
    initLightbox();
    document.getElementById(id).id="";
    }
    else
    setTimeout("pollContent('"+id+"')", 60)
    }
    </script>


    <script type="text/javascript" src="../root/js/prototype.js"></script>
    <script type="text/javascript" src="../root/js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="../root/js/lightbox.js"></script>

    this is to activate the lightbox. i hope this helps.
    thanks,

  3. #33
    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

    This stuff on your gallery.html is useless, get rid of it:

    Code:
    <script type="text/javascript">
    function pollContent(id){
    if(document.getElementById(id)){
    initLightbox();
    document.getElementById(id).id="";
    }
    else
    setTimeout("pollContent('"+id+"')", 60)
    }
    </script>
    
    <link type="text/css" rel="stylesheet" href="../index.php"/>
    <script type="text/javascript" src="../root/js/prototype.js"></script>
    <script type="text/javascript" src="../root/js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="../root/js/lightbox.js"></script>
    <link rel="stylesheet" href="../root/css/lightbox.css" type="text/css" media="screen" />
    You also need an element on gallery.html - at the end of gallery.html - with a unique id like so:

    HTML Code:
    <a href="../images/01.jpg" rel="lightbox[roadtrip]">Start</a>
    <a href="../images/02.jpg" rel="lightbox[roadtrip]">image2</a>
    <a href="../images/05.jpg" rel="lightbox[roadtrip]">image3</a>
    
    <span id="unique1"></span>
    
    </body>
    </html>
    That polling function looks OK for use with lightbox but, it belongs on the 'top' page, I believe that is your index.php page. It could do with a little error checking though:

    Code:
    <script type="text/javascript">
    function pollContent(id){
    if (document.getElementById&&document.getElementById(id)){
    initLightbox();
    document.getElementById(id).id="";
    }
    else if (document.getElementById)
    setTimeout("pollContent('"+id+"')", 60)
    }
    </script>
    Also on that page use this:

    Code:
    <li><a href="javascript:ajaxpage('../menufolder/gallery.html', 'contentarea');" onmousedown="pollContent('unique1');">Gallery</a></li>
    - John
    ________________________

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

  4. #34
    Join Date
    Jul 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi!

    I have a question about ajax script.
    On this page: http://kensai.php1h.com/test/ajaxtabscontent/demo.htm i have put a ajax script, and when for example i click on dog in ajax script it is bringing a external2.htm page. And there i have a thumbnail picture of dog and when i click on it, it is needed to open with lightbox 2.0 script, but when i click on this thumbnail it will only open picture on a white background without lightbox script effect.

    But when i go here to the external2.html page at: http://kensai.php1h.com/test/ajaxtab.../external2.htm and try to click on a picture it is opened with a lightbox srcipt.

    I relly dont know how to solve this problem.

  5. #35
    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

    Quote Originally Posted by Kensai_1
    Hi!

    I have a question about ajax script.
    On this page: http://kensai.php1h.com/test/ajaxtabscontent/demo.htm i have put a ajax script, and when for example i click on dog in ajax script it is bringing a external2.htm page. And there i have a thumbnail picture of dog and when i click on it, it is needed to open with lightbox 2.0 script, but when i click on this thumbnail it will only open picture on a white background without lightbox script effect.

    But when i go here to the external2.html page at: http://kensai.php1h.com/test/ajaxtab.../external2.htm and try to click on a picture it is opened with a lightbox srcipt.

    I relly dont know how to solve this problem.
    Try reading all of the above posts in this thread.
    - John
    ________________________

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

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
  •