{"id":308,"date":"2012-02-13T13:42:30","date_gmt":"2012-02-13T05:42:30","guid":{"rendered":"http:\/\/www.sysadmindayph.com\/blog\/?p=308"},"modified":"2012-02-13T14:08:45","modified_gmt":"2012-02-13T06:08:45","slug":"java-script-mouse-click-change-image-saving-for-future-use","status":"publish","type":"post","link":"https:\/\/www.sysadmindayph.com\/blog\/java-script-mouse-click-change-image-saving-for-future-use\/","title":{"rendered":"java script mouse click change image &#8211; saving for future use"},"content":{"rendered":"<p>I want this to be added on my <a href=\"http:\/\/www.makingmoneyonlineguide.net\/\">Make money online<\/a> blog later<\/p>\n<blockquote><p><script type=\"text\/javascript\">\nfunction changeIt(objName)\n{\n\/\/The image object accessed through its id we mentioned in the DIV block which is going to be visible currently\nvar obj = document.getElementById(objName);<\/p>\n<p>\/\/An array that hold the IDs of images that we mentioned in their DIV blocks\nvar objId = new Array();<\/p>\n<p>\/\/Storing the image IDs into the array starts here\nobjId[0] = \"image1\";\nobjId[1] = \"image2\";\nobjId[2] = \"image3\";\nobjId[3] = \"image4\";\nobjId[4] = \"image5\";\n\/\/Storing the image IDs into the array ends here<\/p>\n<p>\/\/A counter variable going to use for iteration\nvar i;<\/p>\n<p>\/\/A variable that can hold all the other object references other than the object which is going to be visible\nvar tempObj;<\/p>\n<p>\/\/The following loop does the display of a single image based on its ID. The image whose ID we passed into this function will be the\n\/\/only image that is displayed rest of the images will be hidden based on their IDs and that part has been handled by the else part\n\/\/of the if statement within this loop.\nfor(i=0;i<objId.length;i++)\n{\nif(objName == objId[i])\n{\nobj.style.display = \"block\";\n}\nelse\n{\ntempObj = document.getElementById(objId[i]);\ntempObj.style.display = \"none\"; \n}\n}\nreturn; \n}\n<\/script><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>I want this to be added on my Make money online blog later<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":4,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/308\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}