SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    changing init value

    Hi i have the following code

    Code:
    var number = 1;
    var toggler = "p-select";;
    
    function changeTogger() {
     toggler = toggler+number;
    }
    
    featuredcontentglider.init({
    	gliderid: "canadaprovinces", //ID of main glider container
    	contentclass: "glidecontent", //Shared CSS class name of each glider content
    	togglerid: toggler, //ID of toggler container
    	remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
    	selected: 0, //Default selected content index (0=1st)
    	persiststate: false, //Remember last content shown within browser session (true/false)?
    	speed: 400, //Glide animation duration (in milliseconds)
    	direction: "rightleft", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
    	autorotate: false, //Auto rotate contents (true/false)?
    	autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
    })
    There is a toggler value that represents the id name - how can i get this to change, i've included a onclick function which changes the value of it but it's not changing in the init function - how can i make this change...

    Thanks in advance

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Well, what does the init function look like?

    toggler looks like it's a global variable so in init you should be able to to just set it.
    Code javascript:
    toggler = togglerid;


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
  •