Al hacer clic en la imagen te lleva a la parte de arriba de la pagina,
el ejemplo se puede ver en la parte inferior izquierdaScript:<script type="text/javascript">
(function() {
function $(id) {
return document.getElementById(id);
}
function setStyleDisplay(id, status) {
$(id).style.display = status;
}
function goTop(acceleration, time) {
acceleration = acceleration || 0.1;
time = time || 16;
var dx = 0;
var dy = 0;
var bx = 0;
var by = 0;
var wx = 0;
var wy = 0;
if (document.documentElement) {
dx = document.documentElement.scrollLeft || 0;
dy = document.documentElement.scrollTop || 0;
}
if (document.body) {
bx = document.body.scrollLeft || 0;
by = document.body.scrollTop || 0;
}
var wx = window.scrollX || 0;
var wy = window.scrollY || 0;
var x = Math.max(wx, Math.max(bx, dx));
var y = Math.max(wy, Math.max(by, dy));
var speed = 1 + acceleration;
window.scrollTo(Math.floor(x / speed), Math.floor(y / speed));
if(x > 0 || y > 0) {
var invokeFunction = "MGJS.goTop(" + acceleration + ", " + time + ")"
window.setTimeout(invokeFunction, time);
}
}
function switchTab(showPanels, hidePanels, activeTab, activeClass, fadeTab, fadeClass) {
$(activeTab).className = activeClass;
$(fadeTab).className = fadeClass;
var panel, panelList;
panelList = showPanels.split(',');
for (var i = 0; i < panelList.length; i++) {
var panel = panelList[i];
if ($(panel)) {
setStyleDisplay(panel, 'block');
}
}
panelList = hidePanels.split(',');
for (var i = 0; i < panelList.length; i++) {
panel = panelList[i];
if ($(panel)) {
setStyleDisplay(panel, 'none');
}
}
}
window['MGJS'] = {};
window['MGJS']['$'] = $;
window['MGJS']['setStyleDisplay'] = setStyleDisplay;
window['MGJS']['goTop'] = goTop;
window['MGJS']['switchTab'] = switchTab;
})();
function switchImage(imageId, imageUrl, linkId, linkUrl, preview, title, alt) {
if(imageId && imageUrl) {
var image = $(imageId);
image.src = imageUrl;
if(title) {
image.title = title;
}
if(alt) {
image.alt = alt;
}
}
if(linkId && linkUrl) {
var link = $(linkId);
link.href = linkUrl;
}
}
</script>
Y pega este codigo donde quieres que este la imagen que te lleve para arriba al hacer clic:<a id="gotop" onclick="MGJS.goTop();return false;" href="/home.htm" title="Subir" style='display:scroll;position:fixed;bottom:10px;left:5px;'><img src="http://img.webme.com/pic/c/cssplantillas/up.png" border="0"/></a>
Anónimo
26 Sep 2019 - 08:05 am
Canadian Pharm Direct Keflex Tooth Extraction Order Now Dutasteride 0.5mg Real Price Fedex Shipping Viagra Purchase Online With Mastercad