Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Feb 2011
    Location
    England
    Posts
    103
    Member #
    26718
    Liked
    3 times
    I've been battling with a jscript picture gallery for a while and at last I have got close to sorting it.
    I've looked into the source file, simplegallery.js, and identified the array code and how it handles the images in terms of links etc
    element[0] is the image to view
    element[1] is the link address for any hyperlinking
    element[2] is the target
    element[3] is for any sort of text

    the actual code is
    Code:
    simpleGallery.routines={
    
        getSlideHTML:function(imgelement){
            var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
            layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0" />'
            layerHTML+=(imgelement[1])? '</a>' : ''
            return layerHTML //return HTML for this layer
        },
    [COLOR=rgb(0, 0, 0)]In the array in my webpage I would like to leave element[0] as it is, typically "001.jpg"
    Set element[1] to "PrintImage.htm" with it's image source set to "Large/"+element[0] - a larger version of "001.jpg".

    I can't do javascript so would appreciate some help to code this properly if possible?
    Thanks, Lol
    [/COLOR]

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You could open up the image itself. I'm not sure if that would be exactly what you're after, but it could work.

    <a href=\"Large/"+ imgElement[0] + "\">
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member
    Join Date
    Feb 2011
    Location
    England
    Posts
    103
    Member #
    26718
    Liked
    3 times
    Hi, I can bring up a large image in a new window by entering this into the image array fields:
    ["Samurai001.jpg","Samurai/SamuraiLarge/001.jpg","_new",""]
    What I would like to do is open a large image (which has the same name as the standard one but is in a different folder) in a specific page I have created, LargeImage.htm.
    I have tried the following:
    ["Samurai/001.jpg","LargeImage.htm","",""] but modified the SimpleGallery js file from the following:
    Code:
    simpleGallery.routines={
    
        getSlideHTML:function(imgelement){
            var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" target="'+imgelement[2]+'">\n' : '' //hyperlink slide?
            layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0" />'
            layerHTML+=(imgelement[1])? '</a>' : ''
            return layerHTML //return HTML for this layer
        },
    TO:
    Code:
    simpleGallery.routines={
    
        getSlideHTML:function(imgelement){
            var layerHTML=(imgelement[1])? '<a href="'+imgelement[1]+'" <img src="Samurai/SamuraiLarge/'+imgelement[0]+'">>\n' : '' //hyperlink slide?
            layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0" />'
            layerHTML+=(imgelement[1])? '</a>' : ''
            return layerHTML //return HTML for this layer
        },
    But it just isn't working. The page, LargeImage opens but it has no image in it.
    It's probably a syntax thing but I'm struggling on this one (for a change).
    Anyone see where I'm going wrong?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:50 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com