generate: function(){ $("#contenttext br ~ br").each(function(index,element) { $(this).after("<div id=\"bookmark-" + index + "\"></span>"); var key= $('div[id^="bookmark-" ]'); $('div:visible', key) }); }, i want to save the visible div id when the page is scroll down ,and jump back or scroll back to the saved div id when the page is loaded, i am acheiving this by passing static div id (for example #bookmark-65) in the below code , but i want to save the div id according to the scroll position and pass it back when page is reload ,same as saving cookie or local storage...but by using dynamically generated div id's scroll:function() { var container = $('div'), scrollTo = $('#bookmark-65'); container.animate({ scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() }); any one help me..
If you want to save the id and use it in same page then you can do it by assigning it to a variable such as divid="bookmark-" + index ; And use it in anywhere in the same page
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)