Results 1 to 1 of 1

Thread: Need help to understand this javascript code

  1. #1
    Join Date
    Feb 2011
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Need help to understand this javascript code

    Hi, I'm trying to alter this piece of code but first need to understand HOW it works.
    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
    	},
    It's for the simplegallery image viewer and I would like to change the "hyperlink slide" in order for it to open a specified page with a specified imgsrc rather than just a specified page. I have tried some html but got nowhere and this is probably due to my not understanding this piece of code!
    Code:
    imagearray: 
    		["Samurai/001.jpg", "LargeImage.htm", "", ""],
    "Samurai/001.jpg" - element[0] is the image displayed in the gallery
    "LargeImage.htm" - element[1] is the page I would like to hyperlink to and specify its imgsrc from element[2]

    Thanks, Lol
    Last edited by Lol999; 02-23-2011 at 07:32 PM. Reason: added text

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
  •