javascript window.addeventlistener load

Ads

 
 

Share on Google+Share on Google+

Java Coder
javascript window.addeventlistener load
1 Answer(s)      6 years and 2 months ago
Posted in : JavaScript Questions

How to load window.addeventlistener in JavaScript?

Ads
View Answers

September 20, 2011 at 1:11 PM


window.addEventListener('load', function() { 

  var b = document.getElementById('box'),  
      xbox = b.offsetWidth  / 2, // half the box width 
      ybox = b.offsetHeight / 2, // half the box height  
      bstyle = b.style; // cached access to the style object  

  b.addEventListener('touchmove', function(event) {  
    event.preventDefault(); // the default behaviour is scrolling    
    bstyle.left =  event.targetTouches[0].pageX - xbox + 'px';   
    bstyle.top  =  event.targetTouches[0].pageY - ybox + 'px';  
  }, false);  

}, false);

Ads









Related Tutorials/Questions & Answers:
javascript window.addeventlistener load
javascript window.addeventlistener load  How to load window.addeventlistener in JavaScript?   window.addEventListener('load', function() { var b = document.getElementById('box'), xbox = b.offsetWidth / 2
how to load value in dropdown list after selecting value from first dropdown list using javascript
how to load value in dropdown list after selecting value from first dropdown list using javascript  how to load value in dropdown list after selecting value from first dropdown list using javascript
Advertisements
Ajax Load
Ajaxload The ajaxload is a tool, which follow web2.0 standard. Due to slow Internet speed or delay some times data takes time to load. At this time we can incorporate an animated gif image, which indicate user for the loading
Load UIImage from URL
Load UIImage from URL  Load UIImage from URL
how to load pdf on html
how to load pdf on html  how to load pdf on html
Load Icon Image Exception
Load Icon Image Exception  Load Icon Image Exception
JavaScript
JavaScript  clone JavaScript
nsstring load from file
nsstring load from file  Hi, How to load file data into NSString object? Example of nsstring load from file, basically the html file data into NSSTring object. Thanks
jQuery Ajax load request
jQuery Ajax load request  Hi, How to use jQuery to send the request on server to load data in web page? Thanks   Hi, In the jQuery Load... and then load the data in web page. Thanks
UIWebview load url
UIWebview load url  How to load website url in UIWebview? Tell me code for UIWebview load url of a website Thanks...: //Load web view data NSString *strWebsiteUlr = [NSString stringWithFormat:@"http
date in textbox on page load
date in textbox on page load   i want to insret the current date... <script type="text/javascript"> function addDate...;/html>   Here is a javascript code that insert the current date
javascript
javascript  javascript code to dynamically add table on button click.../javascript/javascriptexamples/javascript-add-row-dynamically.shtml http://www.roseindia.net/javascript/javascript-add-row-to-table.shtml http://www.roseindia.net
Javascript
Javascript  How validations are done using javascript ,with example? and interview questions on javASCRIPT
JavaScript
should use JavaScript? Thanks   Hi, JavaScript is scripting language that runs on browser. You have to embed JavaScript in HTML page. Please see JavaScript tutorial. Thanks
JavaScript
JavaScript  how to get full path of a file type in javascript
javascript
javascript  Hi deepak, how to write form validation on javascript
javascript
javascript  write a program to display implement about browsers using javascript
javaScript
javaScript  How to open a browser window that cannot be resized? (HTML + Javascript
javascript
javascript  i have just learned javascript... can you tell me what kind of applications can be made by javascript?? thank you
XML load problem - XML
XML load problem  I have load the xml document in javascript.getting error like ActiveXObject is undefined.Can you help me?  Hi friend... function load(){ var loadXML = new ActiveXObject
load more with jquery
load more with jquery  i am using jquery to loadmore "posts" from my... box its is going to display php posts and after that when i click on load more...; <script type="text/javascript" src="jquery-1.4.4.js"></script>
javascript
javascript  how to set the request or session attribute in javascript head part of jsp page
javascript
javascript  Hi sir, This is sinduri, i want to learn javascript, so plz can u help me.how to learn
javascript
javascript  hi sir, if i want to learn javascript. what concepts i want to know
Load on Startup - JSP-Servlet
Load on Startup  Hi, Can anybody explain the exact use of load-on-startup tag. Where exactly we have to write. Thanks, Naveen  ... of a deployment descriptor is used to load a servlet file when the server starts instead
J2me Map load error
J2me Map load error  Hi , i am making a POC to load google map in my mobile,now i m getting the address of location by its lattitude and longitude in web page , but thing is i wana to store in my net beans emulator , its showing
JAVASCRIPT
JAVASCRIPT  I have one textbox and I want to validate that it must start with number(1-0). can anyone tell me a javascript for that ? thanks in advance
Javascript
Javascript   Javascript to check Numeric entry in checkbox.....   Hi Please find the following code for numeric entry validation in javascript function validateBox(){ var data=document.myForm.someText.value
load and upload. - JSP-Servlet
load and upload.  dear sir, plz give me the sol for my problem.i m waiting for u r reply. why u not replying ..   Hi Friend, We haven't remember your problem. So please send it again. Thanks
session on page load
session on page load  holding session on page load and reload..   <?php session_start(); if (!isset($_SESSION['arr']['counter'])) { $SESSION['arr']['counter'] = 0; } else { $SESSION['arr']['counter']++; } var_dump
javascript
javascript  hi, I was actually working on to calculate the number of days between two dates of yyyy-mm-dd format using javascript, and when i click on button then number of days should be display in textbox

Ads

 
Advertisement null

Ads