Jump to content

carloswebwdf

Members
  • Content count

    6
  • Joined

  • Last visited

About carloswebwdf

  • Rank
    Forum Newcomer
  1. Adapting\Javascript\Image Gallery

    Hello everyone ! I´m trying to adapting an image gallery script.... The below 'show' function is appearing twice but with different names.....because I don´t know javascript ...I did that.....and it is working as I wish............... The only think that I need now is: - "That when the page is loaded".....need to show 'imagem-001.jpg' instead of 'imagem- 000.jpg' ! Could someone give a hand ? The link to see the adapted script is: here The .js code file is down below: ----------------------- //GLOBALS var nl = "\n"; // new line, for nice code :-) var imgFolder = 'imagens_grandes'; //folder with subfolders that contain big images var smallFolder = 'imagens_pequenas'; //folder with subfolders that contain small images (thumbnails) var imgName = 'imagem'; //image name (e.g. the first image is photo-001 - or if you change name to "image" then the first image name is image-001) var imgExt = 'jpg'; //extension (filetype) for big images var smallExt = 'gif'; //extension (filetype) for small images var setColumns = 5; // how many columns per page var setRows = 0; // how many rows to skip before scroll starts, check and adjust manually var setHeight = 76+10+10; // this is important for scroller: max small image (thumbnail) height + <td> padding-top + <td> padding-bottom (see css file) //GLOBALS - GALLERY FOLDERS ('<folder>', <number of images>) var setFolders = Array ( Array('Museu_Leonardo_Da_Vinci',11) ); //GALLERY FUNCTIONS function leadingZero(getImage){ if (getImage < 10)setImage = "00" + getImage; if (getImage > 9 && getImage < 100)setImage = "0" + getImage; if (getImage > 99)setImage = getImage; return setImage; } function initGallery(){ showGallery(0,setFolders[0][1],setFolders[0][0]); } function showMenu(){ returnData = '<tr><td id="menu" colspan="'+ setColumns +'"> | '; for (getFolder = 0; getFolder < setFolders.length; getFolder++){ returnData += '<a href="javascript:showGallery(0,'+setFolders[getFolder][1]+',\''+setFolders[getFolder][0]+'\')">'+setFolders[getFolder][0]+'</a> | '; } returnData += '</td></tr>'+nl; return returnData; } function showGallery(getImage,maxImages,setFolder){ setImage = leadingZero(getImage); if(getImage == 0) { getImage = 1; } imgNxt = getImage + 1; imgPre = getImage - 1; if (imgNxt > maxImages)imgNxt = 1; if (imgPre < 1)imgPre = maxImages; returnData = '<table>'+nl; returnData += '<tr id="selector">'+nl; returnData += '<td><a href="javascript:showImage('+ imgPre +','+ maxImages +',\''+ setFolder +'\')">previous</a></td>'+nl; returnData += '<td align="center"><a href="javascript:window.close();">close</a></td>'+nl; returnData += '<td align="right"><a href="javascript:showImage('+ imgNxt +','+ maxImages +',\''+ setFolder +'\')">next</a></td>'+nl; returnData += '</tr>'+nl; returnData += '<tr><td colspan="3"><a href="javascript:showGallery('+ getImage +','+ maxImages +',\''+ setFolder +'\')"><img src="'+ imgFolder +'/'+ setFolder +'/'+ imgName +'-'+ setImage +'.'+ imgExt +'"></a></td></tr>'+nl; returnData += '<tr id="selector"><td colspan="3">'+ getImage +' / '+ maxImages +'</td></tr>'+nl; returnData += '</table>'+nl; writeData(returnData,0); } function showImage(getImage,maxImages,setFolder){ setImage = leadingZero(getImage); imgNxt = getImage + 1; imgPre = getImage - 1; if (imgNxt > maxImages)imgNxt = 1; if (imgPre < 1)imgPre = maxImages; returnData = '<table>'+nl; returnData += '<tr id="selector">'+nl; returnData += '<td><a href="javascript:showImage('+ imgPre +','+ maxImages +',\''+ setFolder +'\')">previous</a></td>'+nl; returnData += '<td align="center"><a href="javascript:showGallery('+ getImage +','+ maxImages +',\''+ setFolder +'\')">close</a></td>'+nl; returnData += '<td align="right"><a href="javascript:showImage('+ imgNxt +','+ maxImages +',\''+ setFolder +'\')">next</a></td>'+nl; returnData += '</tr>'+nl; returnData += '<tr><td colspan="3"><a href="javascript:showGallery('+ getImage +','+ maxImages +',\''+ setFolder +'\')"><img src="'+ imgFolder +'/'+ setFolder +'/'+ imgName +'-'+ setImage +'.'+ imgExt +'"></a></td></tr>'+nl; returnData += '<tr id="selector"><td colspan="3">'+ getImage +' / '+ maxImages +'</td></tr>'+nl; returnData += '</table>'+nl; writeData(returnData,0); } function writeData(returnData,setScroll){ document.getElementById('gallery').innerHTML = returnData; scrollTo(0,setScroll); } //START initGallery();-----------------------
  2. Adapting\Javascript\Image Gallery

    Ok Mr. ELITE...thanks...it worked...... At the begining appears (1/11) but still at the first page..... an image called 'imagem-000.jpg' shows instead of 'imagem-001.jpg' ..please someone give me a hand..
  3. Adapting\Javascript\Image Gallery

    Ok Mr. ELITE...thanks...it worked...... At the begining appears (1/11) but still at the first page..... an image called 'imagem-000.jpg' shows instead of 'imagem-001.jpg' ..please someone give me a hand..
  4. Adapting\Javascript\Image Gallery

    Hello everyone ! I have a Javascript\Image Galley\Script and trying to modifying it to simple way... The link is (http://www.colegioramoslopez.com/Internet_Explorer_9/image_gallery_test/1/index.html). What I need to do at the moment is: 1-) When the page is loaded...need to stay at (1/11), not (0/11) and obviosly (1/11 with the first image loaded); 2-) When I click the 'close' link, it closes the window... Here´s attached ins .txt the main .js edit file... Wainting for answer Carlos gallery.txt
  5. Simple Realtime Javascript Image Gallery

    Hello everybody ! I intend to recieve an image gallery like the photo below. I´m in a hurry and don´t know Javascript, and don´t want to learn in my way ! Instead to develop with programming, that means, create one particular page to every photo...must have with progmming.....that after the user click at the arrow for next or back...update 'instantly' the photo, the numeration of the photo, and the arrow´s links... I am Webdesigner and only know HTML, CSS, Photoshop, Flash, PHP e MySQL. PHP don´t dominate. I started to search at Google about this kind of simple image gallery and it make me fell tired.. so I give up this search and now I will try complete help result at forums........ Please....somebody help me... I garantee that, if someone help e to resolve this...I´ll give money remuneration ! Wait for fast and resolved answer..please Huge Carlos
×