jquery - Button fixed position -


i fix position of button, cause when click function showcontacts loads , display contacts list on screen , button go footer page;

<button class = "btn" type="button" id='button1' style="visibility: hidden" onclick = "showcontacts()">show contacts</button> 

first things first, question tagged incorrect. has nothing jquery.

to fix button, add example following css:

.btn{   position: fixed;   left: 0;   top: 0: } 

which fix upper left corner of page.

i recommend learn css first

further reading:

mdn css position

edit:

you could, however, accomplish using jquery:

$('.btn').css({   'position':'fixed',   // more rules ); 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -