Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread Poll:
Author: Subject: Calling a function when the slider updates.
lod3
Junior Member

Posts: 2
Registered: 4/17/2008
Location: ireland
Member Is Offline
posted on 4/17/2008 at 12:09 AM Reply With Quote
Calling a function when the slider updates.


Hi, I'd really appreciate if anyone can tell me a solution to this problem.

I have five sliders and five of my own javascript functions.

What I want is for slider one to trigger function one, slider two to trigger function two and so on.

I tried just putting an onchange="function()" in the correct text fields - but this only registers an event when a user actually types something into the field.

thanks!
View User's Profile View All Posts By User U2U Member
lod3
Junior Member

Posts: 2
Registered: 4/17/2008
Location: ireland
Member Is Offline
posted on 4/17/2008 at 12:43 AM Reply With Quote

I found a solution,

I couldn't get the slider itself to register an event, so I wrapped the slider in a div ( <div id="float"> slider code here </div> )

And I then attached an eventlistener to the div in question.

document.getElementById('float').addEventListener('click',everything,false);

Which means every time someone clicks inside the 'float' div (which contains a slider) then a mouse click event will be registered which calls the function everything() - written like so : ('click',everything,false)

butttt

This doesnt work in IE

Using the same method above of wrapping the slider code in a div, simply put onmouseup="function()" when declaring the div:

<div id="float" onmouseup="function()"> slider code </div>

So function() will be called everytime someone clicks on the slider (regardless of if they change the value)

This method appears to work both in firefox and ie.

Hope it helps someone else :)
View User's Profile View All Posts By User U2U Member
Post new thread Poll:

Related Links:
Product Page
Product Demonstrations Live Demos
Multiple Designs
Equalizer
Free Download Free Download
Product Documentation Documentation:
Documentation Page
Change Log
Support Forum Support Forum

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004