javascript - Bottom button does not shift video to bottom where as left and right is working fine -
i've put video inside div, 1 zoom bar zoom video , 4 buttons on each side move video accordingly in left, right, top, bottom side after zooming.
the problem is, left , right button working top , bottom buttons not move video. in example, video panning not working on top , bottom side.
if (parsefloat(document.getelementbyid("myvideo").style.top)<=0) { console.log(parsefloat(document.getelementbyid("myvideo").style.top)); $("#myvideo").css({"top":parsefloat(document.getelementbyid("myvideo").style.top)+1+"%"});
code link-
check code in top , bottom functions.
you're missing parentheses, otherwise you'd concatenating 1
string, ending 30 + 1 + '%'
gives "301%"
etc.
try more verbose approach, remove unwanted characters styles, parse them , add them properly, , use them
var top = document.getelementbyid("myvideo").style.top.replace(/\d+/g,''); var num = parsefloat(top) + 1; $("#myvideo").css({"top": num + "%"});
Comments
Post a Comment