js tweaks
This commit is contained in:
parent
8dcea06077
commit
7006b55818
4 changed files with 34 additions and 38 deletions
|
@ -289,20 +289,18 @@ function getUsabilityHint() {
|
|||
});
|
||||
}
|
||||
|
||||
function getPanTextFunctions() {
|
||||
return {
|
||||
mousein: function () {
|
||||
var sw = $(this)[0].scrollWidth-parseFloat($(this).css("textIndent")), iw = $(this).innerWidth();
|
||||
if (sw > iw) {
|
||||
$(this).stop().animate({
|
||||
textIndent: "-" + (sw + 1 - iw) + "px"
|
||||
}, sw * 8);
|
||||
}
|
||||
},
|
||||
mouseout: function () {
|
||||
function setupTextScrolling(parent, selector) {
|
||||
parent.on("mouseenter", selector, function () {
|
||||
var sw = $(this)[0].scrollWidth - parseFloat($(this).css("textIndent")), iw = $(this).innerWidth();
|
||||
if (sw > iw) {
|
||||
$(this).stop().animate({
|
||||
textIndent: "0"
|
||||
}, 500);
|
||||
textIndent: "-" + (sw + 1 - iw) + "px"
|
||||
}, sw * 8);
|
||||
}
|
||||
}
|
||||
});
|
||||
parent.on("mouseleave", selector, function () {
|
||||
$(this).stop().animate({
|
||||
textIndent: "0"
|
||||
}, 500);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue