Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 421 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sample JavaScript Code for Changing Background-images

#1
<html><head><title>JavaScript Sample</title><link href="style.css" rel="stylesheet" type="text/css" /><script language="javascript" type="text/javascript">// create an array to store the names of imagesvar myArr = new Array();myArr[0] = 'images/image1.jpg';myArr[1] = 'images/image2.jpg';myArr[2] = 'images/image3.jpg';myArr[3] = 'images/image4.jpg';myArr[4] = 'images/image5.jpg';// A global variablevar hiddenArrayIndex;// this function will change the image to the previous image// stored in the arrayfunction movePrevious(){ // get the value stored in the hidden field hiddenArrayIndex = document.getElementById('hiddenValue').value; // if the value is not 0 then decrement the value by 1 and // store it back into the hidden field. if(hiddenArrayIndex != 0) { document.getElementById('hiddenValue').value = parseInt(hiddenArrayIndex) - 1; // re-assign the value to the hiddenArrayIndex variable hiddenArrayIndex = document.getElementById('hiddenValue').value; } // set the background-image stored at the specified Array Index dynamically document.getElementById("div1").style.backgroundImage = "url(" + myArr[hiddenArrayIndex] + ")";}// this function will change the image to the next image// stored in the arrayfunction moveNext(){ // get the value stored in the hidden field hiddenArrayIndex = document.getElementById('hiddenValue').value; // if the value is not equal to the upper index of the array // then increment the value by 1 and store it back into the hidden field if(hiddenArrayIndex != (myArr.length - 1)) { document.getElementById('hiddenValue').value = parseInt(hiddenArrayIndex) + 1; // re-assign the value to the hiddenArrayIndex variable hiddenArrayIndex = document.getElementById('hiddenValue').value; } // set the background-image stored at the specified Array Index dynamically document.getElementById("div1").style.backgroundImage = "url(" + myArr[hiddenArrayIndex] + ")";}</script>
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through