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.

check pics

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-

https://pastebin.com/kk6xzulu

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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -