I have this code:
jQuery(function( $ ){
// If no speed is set (when loading the page) set default speed
if (!$moveSpeed) {
var $moveSpeed = 4000;
}
// Move the damn autocue
$('a.goDown').click(function(){
alert($moveSpeed);
$.scrollTo('#footer', $moveSpeed);
return false;
});
$('a.goUp').click(function(){
alert($moveSpeed);
$.scrollTo('#header', $moveSpeed);
return false;
});
// Speed settings for autocue
$('a.changeSpeed').click(function(){
$moveSpeed = $(this).attr('speed');
return false;
});
});
</script>
and if the changeSpeed is clicked, the alert box shows it is changed to the given number but it aint an integer, is there a way to convert a variable in to an integer?
thx :)
data-prefix on them (e.g.,data-speed). Custom attributes are invalid in HTML4 and earlier; in HTML5, they're valid if they start withdata-. Browsers generally allow invalid attributes and so they work, but they make a document fail validation. More in this article