JavaScript - How To Get Cursor Hand Shape
I've got the following html code for a button - how can I get the cursor to turn into the hand shape when the mouse is over the button?
Thanks PHP Code: <INPUT NAME="btn_cancel" TYPE="button" VALUE="Cancel" onClick="cancel_button_click()";> Similar TutorialsHello, I have a image which need to be cropped from edges slightly to give a hexagon shape. Please see the attached image to see how the appear ance should be. Would lik to crop images while loading on to this frames/boxes. can we do using javascript, can someone help. Thanks. Hi, I've been working at a website for quite some time now, one for my portfolio that displays my graphics design talents. However when coding this website I've run into quite a few problems. The most concerning being the photo gallery I am trying to set up inside of my website. I believe the problem I have is that I have two conflicting scripts, (in which case, how do I 'unconflict' them?) I have a sliding image header and I am using lightbox to create my gallery. While the slider works, my images only work as normal links rather than popping up on the screen. If you have any idea on how to fix this, please let me know. I am also open to other possibilities for a photo gallery. Hello, I am trying to create an input box with a submit button as following: - when any random text is entered in the box, upon submit, a new page should open, based on the text entered: for example: if 'test' is entered ... the new page that opens should be 'test.html' if 'monday' is entered ... the new page that opens should be 'monday.html' Thanks in advance THIS IS NOT HOMEWORK Hi all, I'm trying to extract a URL from a string that may or may not have extra characters before and/or after the URL. I'm having a heck of a time making the regex work... when it works for one case it fails for another and I'm just not seeing why. OK, here is the code: Code: var str = 'leading junk http://h71036.www7.hp.com/hho/images/Outdoor_scene.jpg trailing junk'; var txt = str.replace(/^\s?((https?|ssh|ftp|mailto|file|www):\/\/.*?)\s?$/gi,'href:\n1 is $1\n2 is $2\n3 is $3'); alert(txt); (eventually the replacement string will be <a href="$1">$1</a> of course) What I want is of course to extract "http://h71036.www7.hp.com/hho/images/Outdoor_scene.jpg" out of the string whether of not there is leading and/or trailing "junk" around the string. Any ideas? I'm stumped... Thanks! -- Roger Hello, I'm not sure what to call it. The only way to describe it is a 'window frame'. I need to increase the size. I've been waiting for days to get any kind of response from the theme developers, ElegantThemes.com. If you look at http://www.woodstock2012.com and you click something from the menu a window opens that is very small that has big borders and heavy padding around it. I need to increase the size of this and adjust some margins and padding. Can anyone give me a hand? I sure would appreciate it. This is the code in my custom.js file...the file the admin told me to adjust. Which I did and it didn't work. This is the original code: He said simply, adjust this code... Code: $et_main_content.css( { top : '77px', width : '800px', height : ( et_window_height - 200 ), marginTop : 0, marginLeft : '-400px' } ).removeClass(); I found this code twice in the file: Code: $et_main_content.css( { top : '77px', width : '900px', height : ( et_window_height - 200 ), marginTop : 0, marginLeft : '-400px' }, and I also found this once: Code: $et_main_content.animate( { top : '77px', width : '800px', height : ( et_window_height - 200 ), marginTop : 0, marginLeft : '-400px' }, I change them to: Code: $et_main_content.css( { top : '27px', width : '900px', height : ( et_window_height - 200 ), marginTop : 0, marginLeft : '-450px' }, and Code: $et_main_content.animate( { top : '27px', width : '900px', height : ( et_window_height - 200 ), marginTop : 0, marginLeft : '-450px' }, The results for this change are as such...if I click to a page from the main 'drop in' menu the page loads wide but the minute I use an arrow to change pages or click a page from the menu at the bottom of the page the size reverts back to the 800px. It doesn't lose the margin change from -400px to -450px but it does lose the width. I also need to know how to make it taller and reach closer to the bottom menu and the content slider needs to be adjusted also. I've attached the full js file. If anyone can help me out here I sure would appreciate it. Thank you in advance. Doug I would like to create a caret for a textarea like the one he http://www.dynamicdrive.com/forums/s...4576#post74576 it works great if I want a white background but when I changed it to black and tried to change the textarea's text color to yellow: Code: <textarea type="text" id="setter" style="color:yellow;"onkeydown="writeit(this, event);moveIt(this.value.length, event)" onkeyup="writeit(this, event)" onkeypress="writeit(this, event);"></textarea> I don't see anything on the screen other than the blinking cursor I have some own cursor with a .cur file. But it's very annoying to try changing each part from the css to the new cursor. Is there no aviable script in JS or HTML or CSS or whatever there is, that i can press the link for all cursor like: Pointer, defaut, wait, stop, link and so on. So they all changes into my own? Without having those white cursor. I need a javascript that will print out the X and Y of the mouse on the screen as I move the mouse and keep up to date. The X and the Y must also be stored in a variable. (Trying to increase my knowledge of javascript so that I can make my web sites better and my experiments are all in making games) Do you guys have any idea how I could move a div around a page on mouse down? Like drag and drop it where I want it to be on the page and grab its x,y position? If you guys have any code snippets or tips that would be greatly appreciated thanks! Hi, Would you please try the following in IE: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js"></script> <style type="text/css"> * { font-family: Verdana; font-size: 96%; } label { width: 10em; float: left; } label.error { float: none; color: red; padding-left: .5em; vertical-align: top; } p { clear: both; } .submit { margin-left: 12em; } em { font-weight: bold; padding-right: 1em; vertical-align: top; } </style> <script> $(document).ready(function(){ $("#curl").focus(function(){ if( this.value == this.defaultValue ) { $(this).val("http://"); } }); $("#commentForm").validate(); }); </script> </head> <body> <form class="cmxform" id="commentForm" method="get" action=""> <fieldset> <legend>A simple comment form with submit validation and default messages</legend> <p> <input id="cname" name="name" size="25" class="required" value="Name" /> </p> <p> <input id="cemail" name="email" size="25" class="required email" value="Email" /> </p> <p> <input id="curl" name="url" size="25" class="url" value="URL" /> </p> <p> <textarea id="ccomment" name="comment" cols="22" class="required">Comment</textarea> </p> <p> <input class="submit" type="submit" value="Submit"/> </p> </fieldset> </form> </body> </html> As you see the cursor goes back to the beginning of the field if you focus on the URL field. It works with no problem in other browsers. How can it be corrected? Thanks for any help! I have this image map and I need to change the cursor to finger on mouse over: <map name="Map" > <area shape="rect" coords="0,61,121,140" onClick="scr_valid(1)"> <area shape="rect" coords="175,101,445,204" onClick="scr_valid(0)" > </map> Adding href (<area shape="rect" coords="175,100,445,203" onClick="scr_valid(0)" href="#" >) does not work. Any body could help please? Thank you. i need typing cursor back in first text box after clicking ok of alert [CODE] <html> <head> <script type='text/javascript'> function player() { document.getElementById("Player2").value= document.getElementById("Player1").value; } function notEmpty(elem, helperMsg){ if(elem.value.length == 0){ alert(helperMsg); elem.focus(); return false; } return true; } </script> </head> <body> <form> Player:<input type="Name" id="Player1" onkeyup="player()"/> <input type="Name" id="Player2" DISABLED /> <input type='button' onclick="notEmpty(document.getElementById('Player2'), 'Please fill in player field!')" value='Submit' /> </form> </body> </html> [ICODE] Good day! In my javascript code I have a function for the enter key. I want to add cursor key in that function/ I research about the coding for cursor key but I can't find the code same on what I want to happen. Here is the code: Code: <script language="javascript"> function handleEnter(e, nextfield) { var characterCode = (e && e.which)? e.which: e.keyCode; if(characterCode == 13) { document.getElementById(nextfield).focus(); return false; } else { return true; } } </script> <input type='text' name='plt' onkeypress='return handleEnter(event,\"b0\");' /> Thank you I'm trying to write a function that is similar to the ctrl+f functionality you get in IE, where you have a search string and when you click 'next' the whole string if matched is highlighted by the cursor. This works fine for inputs and text areas using the following code: Code: function setCaretPos(obj, start, end) { var range = obj.createTextRange(); range.moveStart('character', start); range.moveEnd('character', end - obj.value.length); range.select(); } But now I need to get it to work for normal text in a text node that is in the HTML/DOM. Is there an equivalent way of making the above method work for text in text nodes? Alternatively is there a way to make the browser (IE) at least focus on some text in a text node? (I could then highlight it with CSS styles). Hi, Need to put a cursor in a password form on page load here is what I got that does not work. This will be used on a touch screen Code: <script type = "text/javascript"> var count = 2; function validate() { var pw = document.myform.pword.value; var valid = false; /*Failed attempt to put cursor in myform on page Load */ function setCursor(myform){ return set; } var pwArray = ["1701", "Password2", "Password3", "Password4"]; // the corresponding passwords; for (var i=0; i <pwArray.length; i++) { if (pw == pwArray[i]) { valid = true; break; } } if (valid) { alert ("Login was successful"); window.location = "030.html"; return false; } var t = " tries"; if (count == 1) {t = " try"} if (count >= 1) { alert ("Invalid password. You have " + count + t + " left."); document.myform.pword.value = ""; setTimeout("document.myform.pword.select()", 25); count --; } else { alert ("Still incorrect! You have no more tries left!"); document.myform.pword.value = ""; document.myform.pword.disabled = true; return false; } } </script> Thank you for any help. it is required to locate the typing cursor in field after when click ok on java alert thanks in advance !! hello all member help me quick i am create a one form in 10 texbox. i am copy other web Url link when i am paste in textbox cursor not move automatically to the second textbox. and when paste the second textbox the cursor move the not third textbox. please help me how can move automatically cursor textbox only past. not mixmim leg using. only using paste. send completely code java script and input code quickly thanks Hi, I have written a function to compare each character in startString with another nominated character (nomChar). If they are the same this character is written to outputString, in the same position. If they are not the same a character is lifted from the same position in altString and placed in the same position in outputString instead. I hope that's clear! Code as follows: Code: function compareChar(startString, altString, nomChar) { var outputString = ''; outputString.length = startString.length; var nextLetter = ''; for (var count = 0; count < startString.length; count = count + 1) { nextLetter = startString.charAt(count); if (nextLetter == nomChar) { outputString.charAt(count) = nextLetter; } else { outputString.charAt(count) = altString.charAt(count); } } } document.write(compareChar('boston', 'denver' , 'o' ) ); However, the line of code within the if statement Code: outputString.charAt(count) = nextLetter; keeps generating an 'Invalid assigment left hand side' error message. Can anyone see why this is the case? Thanks. The suspect line is the following $('.leaveClan').attr('id') = <?php echo $id; ?>; the span with the class (there is only one) leaveClan is on the main page, and that line of javascript is on a page being called by AJAX within that page. Can anyone see why that is causing an error? Let me know if you need to see any more of the code Hi all, I'd like to use the bbcode editor at http://php-login-script.com/bbdemo.php. Currently that script doesn't set the focus on the textarea after tag insertion. I've tried to to make it by inserting textarea.focus() at the end of their function, like Code: function doAddTags(tag1,tag2,obj) { textarea = document.getElementById(obj); // Code for IE if (document.selection) { textarea.focus(); var sel = document.selection.createRange(); //alert(sel.text); sel.text = tag1 + sel.text + tag2; } else { // Code for Mozilla Firefox var len = textarea.value.length; var start = textarea.selectionStart; var end = textarea.selectionEnd; var scrollTop = textarea.scrollTop; var scrollLeft = textarea.scrollLeft; var sel = textarea.value.substring(start, end); //alert(sel); var rep = tag1 + sel + tag2; textarea.value = textarea.value.substring(0,start) + rep + textarea.value.substring(end,len); textarea.scrollTop = scrollTop; textarea.scrollLeft = scrollLeft; } textarea.focus(); } But, in IE that sets the cursor the end of the last inserted tag and in FF the cursor moves at the end of the whole text in textarea. How can i set it ine between the tags(say ), after insert? Thanks. |