TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-01-2011, 06:22 PM   #1 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 175
Thanks: 9
captainmerton is on a distinguished road
Default Javascript Array

I've created a property website where i have 15 images displayed for each property. At present they are displayed as a lead image at full size and then 15 thumbnails each of which when clicked (using javascript onclick function) display as the lead image. I want to add a <- and -> arrows which u user can click to go through the images one by one (i.e. when they click forward the next image becomes the lead image). To do this i am thinking i need to store all 15 image urls in a javascript array which i then access using a javascript function every time a user clicks -> next image or <- previous image. How do i start going about doing this? Any help much appreciated. I obviously have an array in the php which i access to display the 15 images on the page.
captainmerton is offline  
Reply With Quote
Old 06-01-2011, 07:06 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 312
Thanks: 8
tony is on a distinguished road
Default

you mean like a carousel? Maybe something like this http://billwscott.com/carousel/carousel_spotlight.html it is a more inticrated process (at least for me) I would look for examples on javascript slideshows or carousels
tony is offline  
Reply With Quote
Old 06-02-2011, 04:21 PM   #3 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 175
Thanks: 9
captainmerton is on a distinguished road
Default

Didnt really think about a carousel but that example you posted Tony would be perfect. I'll try and integrate into my website. Many thanks.
captainmerton is offline  
Reply With Quote
Old 06-02-2011, 05:02 PM   #4 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 175
Thanks: 9
captainmerton is on a distinguished road
Default

Struggling to make this work. Although it was perfect. Questions i have are:

(1) Do i need to link to every one of those css and js files in my html?
(2) I want to build the image and image url list in the javascript by querying a database in php. How best do i do that so the javascript details the correct picture array when th page loads?

Many Thanks.
captainmerton is offline  
Reply With Quote
Old 06-02-2011, 05:07 PM   #5 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 175
Thanks: 9
captainmerton is on a distinguished road
Default

I've found details taking me through exactly what i need to do. Will read these. Many thanks.

http://billwscott.com/carousel/
captainmerton is offline  
Reply With Quote
Old 06-03-2011, 01:10 AM   #6 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 312
Thanks: 8
tony is on a distinguished road
Default

good, I haven't done something like this since javascript dom interaction was called DHTML (a looong time ago)
tony is offline  
Reply With Quote
Old 06-03-2011, 01:47 AM   #7 (permalink)
The Wanderer
 
jacket250's Avatar
 
Join Date: Jun 2011
Posts: 7
Thanks: 0
jacket250 is on a distinguished road
Default

yoo .you guys know about JA code?? thats gteat...can you teach me??
jacket250 is offline  
Reply With Quote
Old 06-08-2011, 06:19 PM   #8 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 312
Thanks: 8
tony is on a distinguished road
Default

I don't know that JA code is.
tony is offline  
Reply With Quote
Old 06-09-2011, 07:56 AM   #9 (permalink)
Banned
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
jewelryab is on a distinguished road
Default

I have just visited your site and I will say that you did good work but templates are very costly.

Tera Online CDK WOW Items
jewelryab is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Group Array "teams" and add up points godsdead General 3 07-15-2009 08:38 PM
Easily Format JSON using PHP and Interpret using Javascript Wildhoney Advanced PHP Programming 9 06-22-2009 01:12 AM
How to search array benton General 3 03-29-2009 12:31 AM
Array mess Killswitch Absolute Beginners 4 12-14-2008 06:35 AM
Part 1: Getting Started with Array Functions Wildhoney Absolute Beginners 6 10-01-2007 10:53 AM


All times are GMT. The time now is 11:44 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design