text box to be of fixed header

Momo

New Member
when you reduce the browser window you will see a different lay out....when you scroll down the search text box goes up and its not fixed so its not visible...how to make the search text box as fixed when you scroll down....i used the code from another example but the problem is when i implement with my new code its not working....i am trying to work with the data tables search box....don't know whats wrong in my code....http://jsfiddle.net/bz2C4/11/\[code\]$(function() { var search = $('.dataTables_filter').detach(); $('.page-title').before(search); search.css('margin-left','0'); var div = $('.dataTables_filter'); var start = $(div).offset().top; $.event.add(window, "scroll", function() { var p = $(window).scrollTop(); $(div).css('position', ((p) > start) ? 'fixed' : 'static'); $(div).css('top', ((p) > start) ? '0px' : ''); }); });\[/code\]
 
Back
Top