<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>exemple</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************ OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO OO ************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************ <script type="text/javascript"> var isIE = !!(window.attachEvent && !window.opera) ? true : false; function getWindowDimensions(){ var width = document.documentElement['clientWidth']; var height = document.documentElement['clientHeight']; return {width: width, height: height}; } function addEvent(elt, eEvent, fCallBack){ isIE ? elt.attachEvent('on'+eEvent, fCallBack) : elt.addEventListener(eEvent, fCallBack, false); } function centerView(event){ var cursorPosition = { x: event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)), y: event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) } document.getElementById('pointer').style.left = cursorPosition.x-4+'px'; document.getElementById('pointer').style.top = cursorPosition.y-4+'px'; document.getElementById('pointer').style.display = 'block'; window.scrollTo(cursorPosition.x-(getWindowDimensions().width/2), cursorPosition.y-(getWindowDimensions().height/2)); } addEvent(document, 'click', centerView); </script> </html>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question