Results 1 to 6 of 6

Thread: Gallery script not functioning

  1. #1
    Join Date
    Mar 2012
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Gallery script not functioning

    I am trying to make a web gallery using the following code on my blog, and the thumbnail images will not load. I tried it out another a blank blog, and it worked fine, so I know I must have something embedded on my site that is preventing it from working. Any recommendations on what to change?



    Many thanks



    HTML Code:
    <div id="content">
    <script type="text/javascript">
        function myshowImages(id) {
    
             /**$(".bigPic").hide();
                $("#pic-"+id).show();*/
                $('.bigPic').css({'display':'none'});
                $("#pic-"+id).fadeIn('slow'); 
    
        }
    </script>
    <script>
        $(document).ready(function () {
            $('.email-sign-up').css({'marginBottom':'0px'});        
        })
    </script>
    
    <div class="product">
        <div class="galerie">
            <div class="bigPics">
                <a href="insert" target="_blank">
                    <img src="insert" title="" alt="" id="pic-0" width="450" height="450" class="bigPic" name="bigPic"  />
                </a>
                <a href="insert" target="_blank">
                    <img src="insert" title="" alt="" id="pic-1" width="450" height="450" class="bigPic" name="bigPic" style="display:none;" />
                </a>
            </div>
    
            <div class="thumbnails">
                <div class="mini-thumb">
                    <a href="javascript:myshowImages(0)" >
                        <img src="insert" title="" alt="" />
                    </a>
                </div>
                <div class="mini-thumb">
                    <a href="javascript:myshowImages(1)" >
                         <img src="insert" title="" alt="" />
                    </a>
                </div>
    Last edited by jessamca; 03-23-2012 at 09:45 PM. Reason: remove link, the code wasn't on it

  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

    Works fine here.

    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

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

  3. #3
    Join Date
    Mar 2012
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, the script works fine, i tested it on another site as well. i think there is something in my current template that is not allowing it to work. i published the post where it is not functioning for you to see now.

  4. #4
    Join Date
    Mar 2012
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oops! i didnt realize the link didnt attach, my mistake!
    Last edited by jessamca; 03-23-2012 at 09:45 PM.

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

    Ah, I had removed the link because I couldn't find the code on the page. I'm not sure why that happened, I see it there now.

    There could be other problems but the code in your post requires the jQuery script library. I added it to the page and the gallery worked, so that might be the only problem.

    Where you have this:

    Code:
    </tbody></table></div><script type="text/javascript">
    function myshowImages(id) {
    
     /* $(".bigPic").hide();
     $("#pic-"+id).show();*/
     $('.bigPic').css({'display':'none'});
     $("#pic-"+id).fadeIn('slow'); 
     
    }
    </script><br />
    Make it like so:

    Code:
    </tbody></table></div>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
    <script type="text/javascript">
    function myshowImages(id) {
    
     /* $(".bigPic").hide();
     $("#pic-"+id).show();*/
     $('.bigPic').css({'display':'none'});
     $("#pic-"+id).fadeIn('slow'); 
     
    }
    </script><br />
    - John
    ________________________

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

  6. #6
    Join Date
    Mar 2012
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it works, THANK YOU!!!!

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
  •