There is a page . It contains links with anchors to the layers below. Also attached to the page is a script that scrolls to the anchor (layer) specified in the link.
Each of these layers to which the scroll is performed is a mini sketch, when clicked, the image is enlarged. Zoom is implemented using the highslide script.
It is necessary to make everything happen in the following scenario:
Click on the link - Scroll to a layer, and then increase the picture.
In other words, you need to register in the scrolling script, so that when you reach the desired anchor, you click on the sketch. I am not familiar with JavaScript, but I think the task is not difficult!
The script scroll code is:
spScrollToHash = { autor: { name: 'Szen', site: 'http://szenprogs.ru/', page: 'http://szenprogs.ru/blog/plavnyj_skrolling_v_ljubom_napravlenii/2011-06-21-111', ver: '1.0 beta' }, scroll: function (id, speed, typ) { if (id == '' || id == '#' || $(id).length == 0) return false; if (speed == undefined || speed < 1 || speed > 1000) speed = 500; if (typ == undefined || typ < 1 || typ > 3) typ = 1; var par = 'html' if ($.browser.safari) par = 'body'; var offset = $(id).offset(); spScrollToHash.stop(); switch (typ) { case 1: $(par).animate({ scrollTop: offset.top, scrollLeft: offset.left }, speed, function () { document.location.hash = id; }); break; case 2: $(par).animate({ scrollTop: offset.top }, Math.round(speed / 2), function () { $(par).animate({ scrollLeft: offset.left }, Math.round(speed / 2), function () { document.location.hash = id; }); }); break; case 3: $(par).animate({ scrollLeft: offset.left }, Math.round(speed / 2), function () { $(par).animate({ scrollTop: offset.top }, Math.round(speed / 2), function () { document.location.hash = id; }); }); break; } return false; }, stop: function () { $('a[href*="#"]').stop(); }, ready: function (speed, typ) { var id = document.location.hash; spScrollToHash.scroll(id, speed, typ); $('a[href*="#"]').click(function () { id = $(this).attr('href'); id = id.substr(id.indexOf('#')); spScrollToHash.scroll(id, speed, typ); return false; }); } } $(function () { spScrollToHash.ready(400, 1); });