This is a very simple background changer. It just takes the selected value from the list and makes that the background color. Insert the following code inside the <body> tag: <FORM><SELECT Size=5 name=clr onChange=”document.bgColor=this.options[this.selectedIndex].value”><OPTION VALUE=”blue”>blue<OPTION VALUE=”aquamarine”>aquamarine<OPTION VALUE=”chocolate”>chocolate<OPTION VALUE=”darkred”>dark red<OPTION VALUE=”gold”>gold<OPTION VALUE=”red”>red<OPTION VALUE=”yellow”>yellow<OPTION VALUE=”hotpink”>hotpink<OPTION VALUE=”lime”>lime<OPTION VALUE=”darkkhaki”>dark khaki<OPTION VALUE=”cadetblue “>cadet blue<OPTION VALUE=”darkgoldenrod”>dark goldenrod<OPTION VALUE=”darkslateblue”>dark slate<OPTION VALUE=”blue”>blue<OPTION VALUE=”deeppink”>deep …
Category: JavaScript
JS or Js may stand for JavaScript The filename extension .js is used for JavaScript and JScript files
Permanent link to this article: https://blog.openshell.in/2011/03/list-changer/
Feb 14
Warning before navigate away from a page
In some cases, if you are in between any work of editing or typing a content, and you wont let the visitor to navigate away from the page without particular condition, say the document is not saved yet, you can block the navigation (even the closing of the browser window) with Javascript. Code: window.onbeforeunload = …
Permanent link to this article: https://blog.openshell.in/2011/02/warning-before-navigate-away-from-a-page/
Feb 14
jQuery Traversing Tips
Just a quick review of tips available in jQuery to manage nodes (contents) near by the content / node which is triggered an event like click, hover etc Functions: find, parent, parents, children, first, last, closest Suppose you need to manage some nodes nearby a link or a button on an event. Say $(‘.button’).click(function(){ // …
Permanent link to this article: https://blog.openshell.in/2011/02/jquery-traversing-tips/
Dec 17
How to avoid Conflict in jQuery
Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery’s case, $ is just an alias for jQuery, so all functionality is available without using $. If we need to use another JavaScript library alongside jQuery, we can return control of $ back to the other library with …
Permanent link to this article: https://blog.openshell.in/2010/12/how-to-avoid-conflict-in-jquery/
Dec 06
Tips for using jQuery
Find if something is hidden: We use .hide(), .show() methods in jquery to change the visibility of an element. Use following code to check the whether an element is visible or not. if($(element).is(“:visible”) == “true”) { //The element is Visible } Center an element on the Screen: To make align the element to center. jQuery.fn.center …
Permanent link to this article: https://blog.openshell.in/2010/12/tips-for-using-jquery/
Permanent link to this article: https://blog.openshell.in/2010/12/slideshow-using-jquery/
- 1
- 2