JavaScript - How To Scroll 2 Things At Once (need Help)
Hello, sorry to bother you all - I am quite new to javascript, i have found an engine that i would like to edit, in the following javascript code, it will contain code on moving a player to the left, what i want is for every 32px it moves the player left, i want it to also to scroll the map at the same time (it's all contained in a div called "global_map") - Please help me, i am in urgent need of help please and thank you guys!
Code: function player_move_left(user_id, bloc_id, charaset, prefix) { var player_id = prefix + user_id; var next_left_pos = Math.round((parseInt(document.getElementById(player_id).style.left) - tile_size + player[user_id].left_gain) / tile_size); var next_top_pos = Math.round((parseInt(document.getElementById(player_id).style.top) + player[user_id].top_gain) / tile_size); //var next_lower_bloc = 'l' + next_left_pos + '-' + next_top_pos; //var next_upper_bloc = 'u' + next_left_pos + '-' + next_top_pos; var next_event_bloc = 'i' + next_left_pos + '-' + next_top_pos; if ( map_pass[next_top_pos][next_left_pos] ) { if ( user_id == my_user_id ) { move_update(bloc_id, -1, 0); } document.getElementById('charaset_' + user_id).style.top = -player[user_id].height + 'px'; setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[1] + ') + \'px\';', 62); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[2] + ') + \'px\';', 125); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[3] + ') + \'px\';', 187); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[4] + ') + \'px\';', 250); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[5] + ') + \'px\';', 312); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[6] + ') + \'px\';', 375); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[7] + ') + \'px\';', 437); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[8] + ') + \'px\';', 500); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[9] + ') + \'px\';', 562); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[10] + ') + \'px\';', 625); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[11] + ') + \'px\';', 687); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[12] + ') + \'px\';', 750); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[13] + ') + \'px\';', 812); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[14] + ') + \'px\';', 875); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[15] + ') + \'px\';', 937); setTimeout('document.getElementById(\'' + player_id + '\').style.left = (parseInt(document.getElementById(\'' + player_id + '\').style.left) - ' + division[16] + ') + \'px\';', 1000); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'-' + player[user_id].width + 'px\';', 63); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'-' + (player[user_id].width * 2) + 'px\';', 188); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'-' + (player[user_id].width * 3) + 'px\';', 313); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'0px\';', 438); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'-' + player[user_id].width + 'px\';', 563); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'-' + (player[user_id].width * 2) + 'px\';', 688); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'-' + (player[user_id].width * 3) + 'px\';', 813); setTimeout('document.getElementById(\'charaset_' + user_id + '\').style.left = \'0px\';', 938); /*if ( (parseInt(document.getElementById(player_id).style.left) - tile_size + player[user_id].left_gain) > parseInt(document.getElementById(bloc_id).style.left) ) { setTimeout('player_move_left(\'' + user_id + '\', \'' + bloc_id + '\', \'' + charaset + '\', \'' + prefix + '\')', 1000); } else {*/ if ( prefix == 'p' ) { if ( user_id == my_user_id && events_placement[next_top_pos][next_left_pos][0].length > 0 ) { if ( path_finished ) { setTimeout('exec_event(' + user_id + ', ' + next_left_pos + ', ' + next_top_pos + ', 0);', 1000); } } else { setTimeout('player[' + user_id + '].moving = false;', 1000); } } /*}*/ } else { document.getElementById('charaset_' + user_id).style.top = -player[user_id].height + 'px'; if ( prefix == 'p' ) { if ( user_id == my_user_id && events_placement[next_top_pos][next_left_pos][1].length > 0 ) { if ( event_data[next_event_bloc].changedir ) { document.getElementById('charaset_' + next_event_bloc).style.top = '-' + (parseInt(document.getElementById('charaset_' + next_event_bloc).style.height) / 2) + 'px'; } if ( user_id == my_user_id ) { move_update(bloc_id, 0, 0); } exec_event(user_id, next_left_pos, next_top_pos, 1); } else { player[user_id].moving = false; } } } } If you still don't get what i am asking for (which i appreciate!) is that i want to know how to scroll 2 things at the same time (the player div and the global_map div) Similar TutorialsHi all, I was wondering if i could have some help - i am not very technical! I would like to add 2 things to an onSubmit that is on a form. However, I have been reading various things as to whether or not this is possible. The button on the form looks like it runs some sort of validation as it starts with onsubmit="validateFormData...... I am trying to set up a goal in analytics and need to add a pageview tracker to the onSubmit as well. Is this possible? Please help me Ok, I have a submit form that allows the user to submit news, here is the final step of the form: Code: <form action="{$URL_submit}" method="post" id="thisform" name="ATISUBMIT" > <input type="hidden" name="phase" value="3" /> <input type="hidden" name="randkey" value="{$templatelite.post.randkey}" /> <input type="hidden" name="id" value="{$submit_id}" /> <input type="hidden" name="trackback" value="{$templatelite.post.trackback|escape:"html"}" /> <br style="clear: both;" /><hr /> <center> <input type=button onclick="javascript:gPageIsOkToExit=true;window.history.go(-1);" value="{#PLIGG_Visual_Submit3_Modify#}" class="log2"> <input type="button" onclick="javascript:submitEdgeStory();" value="{#PLIGG_Visual_Submit3_SubmitStory#}" class="submit" /> </center> </form> The submit button already has an "onclick" function via Javascript. What I want to add is a checkbox to the form, that when checked, the form will submit as per usualy, but will also open a new tab that will load a website. Is this possible to do? Thanks, Geoserv. Can a checkbox do 2 different things after it is clicked? Right now I am using this... Code: <input type="checkbox" onclick="processCheckbox(this);"> <input type="checkbox" onclick="activLink(this.checked)"> I don't want to have 2 checkboxes on my page, just 1 and get the same result. Is this possible? Chad I have been on loads of websites, and they all say the same thing. But the below script will just not change the opacity of the element - which is a DIV - in IE... I do not see why not, W3C says that obj.filters.alpha.opacity = 50; will do it, but it produces an error saying that filers.alpha is null or not defined... Code: function setOpacity(obj) { obj.style.opacity = "0.5"; obj.filters.alpha.opacity = 50; obj.style.filter = 'alpha(opacity=50)'; } Hey all - I need a java bookmarklet that does a real simple thing. I need to take the current URL (ie, where the user is when they click the bookmarklet) and append it to a static URL and return the text on the resulting page. For example: The user is at http://google.com The user clicks the bookmarklet. the bookmarklet takes http://google.com and appends it to http://example.com/outside_create.ph...ey=555&url=URL HERE where you see the URL HERE text. That PHP script echos a simple line of text (a shortened URL actually). Then I want that result from the outside_create.php file to be displayed in a window back to the user. Is this even possible? Basically I need to know how to append location.href to a static URL and how to get the resulting content from the static URL.. Greetz, I am new to JS and using code that someone gave me. I have cleaned up the code, made it standard compliant and tailored it to my need. The code is for an ultra basic picture gallery. The code is almost perfect, but there is one undesirable effect in which when an image is selected from the thumbnail gallery, the thumbnail dissapears as I am guessing its the same element, just blown up. What I would like to know is how I can stop it from happening? I will post the full output of the HTML file. I have also uploaded zip file which contains the HTML file and two images, so one may see the compiled page as I do. Zip file (Note: STUPID hosting site placed the DOWNLOAD button right under "MP3 ringtones"... Clicking download will not take you to some premium SMS service or anything like that): http://qfs.mobi/f31666 Code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <TITLE></TITLE> <META content="charset=windows-1252;text/html" http-equiv="content-type"> <SCRIPT type="text/javascript"> clickMenu = function(menu) { var getEls = document.getElementById(menu).getElementsByTagName("LI"); var getAgn = getEls; for (var i=0; i<getEls.length; i++) { getEls[i].onclick=function() { for (var x=0; x<getAgn.length; x++) { getAgn[x].className=getAgn[x].className.replace("click", ""); } this.className+=" click"; } } } </SCRIPT> <STYLE type="text/css"> #gallery ul { float:right; overflow:auto } #gallery ul li { display:inline; width:50px; height:50px; float:left; margin:0 4px 4px 0; border:1px solid #444; cursor:pointer } #gallery ul li img { display:block; height:50px } #gallery ul li span { display:none; position:absolute; left:447px; top:235px; font-family:verdana; color:#06a } #gallery ul li.click { border-color:#fc0; cursor:default } #gallery ul li.click i { position:absolute; left:0; width:545px } #gallery ul li.click i img { margin:5px auto 0 auto; height:auto } #gallery ul li.click span { display:block } </STYLE> <BODY onload="clickMenu('gallery')"> <DIV id="gallery"> <UL> <LI><I><IMG src="1.png" title="" alt=""></I><SPAN>Front</SPAN></LI> <LI><I><IMG src="2.png" title="" alt=""></I><SPAN>Back</SPAN></LI> </UL> </DIV> </BODY> Much appreciated! I'd like to know if there are ways to hide/unhide fields like radio options, text fields & others by using JavaScript. If so how do I do it? I do know I will have to check the form every time. Is there a need to refresh the form? Will the refresh clear all the selections? Things I'd like to hide: 1. Upon the selection of a radio option, another radio option will appear. 2. Upon the selection of a radio option, a text field will appear. Sorry for asking so many questions. But I just got to know that I need to use JavaScript in my application and I have no idea how and where to start, just bumping around, & hoping that God will drop some hint. Hey all, I'm trying to fully understand javascript and have a couple of questions I was hoping you could answer for me. I'm working through a book and in the book I'm creating a Bingo card that generates a random number. I'm pasting the full script below just in case it's needed. Code: function initAll () { for(var i=0; i<24; i++) { setSquare(i); } } function setSquare(thisSquare) { var currSquare= "square" + thisSquare; var colPlace= new Array (0,0,0,0,0,1,1,1,1,1,2,2,2,2,3,3,3,3,3,4,4,4,4,4); var colBasis=colPlace[thisSquare] *15; var newNum=colBasis +getNewNum()+1; document.getElementById(currSquare).innerHTML=newNum; } function getNewNum() { return Math.floor(Math.random() *15); } //--> </script> 1. What does the [thisSquare] mean in this line of code that is bolded? I mean, I know thisSquare is whatever i is, but am I multiplying it by colPlace or what? 2. Lastly I'm confused by this part of the above code Code: var newNum=colBasis +getNewNum()+1; Why add the +1? I mean, i think getNewNum is set to pull a random number between 1 and 14. If you want to pull a number between 1 and 15, why not multiple Math.random() *16 instead of 15. Am i missing something? Sorry, I'm just not understanding why use the +1 Morning all. My script is running he http://www.actwebdesigns.co.uk/web-d...php-jquery.php It is an ajax style uploader. My problem being: when image is uploaded, it calls for a refreshed list of images that have been uploaded. But once it has been refreshed once, the "get height and width" function no longer works. Firebug returns: Code: self.parent is null Code: var image = self.parent.$("#imageSelect :selected").text(); here's my code: act.uploader.iframe.js Code: // JavaScript Document $(document).ready(function () { var pageContents = $("body").html(); function getHeightAndWidth() { self.parent.$("#getHeightWidth").bind("click", function () { var dir = "getHeightAndWidth.php"; //directory to script var image = self.parent.$("#imageSelect :selected").text(); self.parent.$("input[class=userInput2], select, #getHeightWidth").attr('disabled', true); self.parent.$("#getError").html('<p>Gathering data please wait... <img src="loader.gif" /></p>'); $.ajax({ type: "POST", url: dir, data: 'image=' + image, cache: false, timeout:30000, error: function () { self.parent.$("#getError").html("<p>We are currently have a large volume of users and are slowing down our system. Please try again later.</p>"); self.parent.$("input[class=userInput2], select, #getHeightWidth").removeAttr('disabled'); }, success: function (html) { self.parent.$("#heightAndWidthWrapper").html(html); self.parent.$("input[class=userInput2], select, #getHeightWidth").removeAttr('disabled'); } }); }); self.parent.$("#uploaderIframe").remove(); } function buttonConvert() { // this function can be used on any page you want to make more accessible. Turns all type="submit" into type="button" self.parent.$("input[type=submit]").each(function () { var buttonClassFind = $(this).attr("class"); if (buttonClassFind!="leave") { var inputButton = $(this); var newInputButton = $('<input type="button" id="' + inputButton.attr('id') + '" name="' + inputButton.attr('name') + '" class="' + inputButton.attr('class') + '" value="' + inputButton.val() + '" rel="' + inputButton.attr('rel') + '"/>').insertBefore(inputButton); inputButton.remove(); } }); } function refreshImages() { self.parent.$("#sizeOptionsWrapper").html('<p>refreshing... <img src="loader.gif" /></p>'); $.ajax({ url: 'function.loadImages.php', cache: false, timeout:30000, error: function () { self.parent.$("#sizeOptionsWrapper").html("<p>We are currently have a large volume of users and are slowing down our system. Please try again later.</p>"); self.parent.$("#uploaderIframe").remove(); }, success: function (html) { self.parent.$("#sizeOptionsWrapper").html(html); buttonConvert(); getHeightAndWidth(); } }); } self.parent.$("#uploadResult").html(pageContents); refreshImages(); }); act.uploader.js Code: // JavaScript Document $(document).ready(function () { window.name = "main"; function upload() { $("#uploadSubmit").bind("click", function () { var results = '<iframe name="uploader" id="uploaderIframe"></iframe>'; $("#uploader").append(results); $("#uploadResult").html('<p>Uploading please wait... <img src="loader.gif" /></p>'); }); } function getHeightAndWidth() { $("#getHeightWidth").bind("click", function () { var dir = "getHeightAndWidth.php"; //directory to script var image = $("#imageSelect :selected").text(); $("input[class=userInput2], select, #getHeightWidth").attr('disabled', true); $("#getError").html('<p>Gathering data please wait... <img src="loader.gif" /></p>'); $.ajax({ type: "POST", url: dir, data: 'image=' + image, cache: false, timeout:30000, error: function () { $("#getError").html("<p>We are currently have a large volume of users and are slowing down our system. Please try again later.</p>"); $("input[class=userInput2], select, #getHeightWidth").removeAttr('disabled'); }, success: function (html) { $("#heightAndWidthWrapper").html(html); $("input[class=userInput2], select, #getHeightWidth").removeAttr('disabled'); } }); }); } function buttonConvert() { // this function can be used on any page you want to make more accessible. Turns all type="submit" into type="button" $("input[type=submit]").each(function () { var buttonClassFind = $(this).attr("class"); if (buttonClassFind!="leave") { var inputButton = $(this); var newInputButton = $('<input type="button" id="' + inputButton.attr('id') + '" name="' + inputButton.attr('name') + '" class="' + inputButton.attr('class') + '" value="' + inputButton.val() + '" rel="' + inputButton.attr('rel') + '"/>').insertBefore(inputButton); inputButton.remove(); } }); } buttonConvert(); upload(); getHeightAndWidth(); }); if need the php or html let me know. Any help much appreciated. hey guys. got acouple questions for my website. im more of a html guy.. and i usually find my scripts online. i reeaaallly appreciate all answers! i have a box: <img id="imgSearch" src="" alt="Websites" /> <input type="button" value="Toggle Search" id="btnSearch" /> ^being the button to toggle between websites. basically i'd like this button to toggle between different websites when clicked. secondly: changing span tag colors html code: Traffic Light: <span id="trafficLight"></span> <input type="button" value="Prevent Accident" id="btnTraffic" /> i'd like to change the color of this span id by pressing the button. so in this case it would change red, yellow green and last: changing the font in a bold tag bold by pressing a button html code: (note, the font weight in normal in css for bold) <b>i want this bold when you hit the button!</b> <input type="button" value="Set Bold" id="btnBold" /> Here are the coding.. Code: <jsp:useBean id="chequeStopBean" scope="session" class="my.com.infopro.ibank.ui.bean.ChequeStopBean"/> <jsp:useBean id="labelBean" scope="session" class="my.com.infopro.ibank.ui.bean.LabelBean"/> <jsp:useBean id="lang" scope="session" class="my.com.infopro.ibank.ui.bean.LanguageBean" /> <%@ page language="java" import = "java.util.*" errorPage="" %> <%@ page import="my.com.infopro.ibank.dto.ChequeDTO"%> <% request.getSession(true); String contextPath = request.getContextPath(); chequeStopBean.queryAccList(); //RequestDispatcher dispatcher = null; %> <html> <head> <title><%=labelBean.getLabel("STOP_CHEQUE")%></title> <meta HTTP-EQUIV="Pragma" content="no-cache"> <meta HTTP-EQUIV="Expires" content="-1"> <jsp:include page="/ScriptHeader.jsp"/> <script language="javascript"> function validateAndSubmit() { var msg1 = "<%=labelBean.getLabel("MSG_REQUIRED_FIELD")%>"; var msg2 = "<%=labelBean.getLabel("MSG_CANNOT_CONTAIN_CHARACTER")%>"; var msg3 = "<%=labelBean.getLabel("MSG_IN_THE_FIELD")%>"; var msg4 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER")%>"; var msg5 = "<%=labelBean.getLabel("WITH")%>"; var msg6 = "<%=labelBean.getLabel("TO")%>"; var msg7 = "<%=labelBean.getLabel("MSG_CHARACTER")%>"; var msg8 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_VALID_NUMBER")%>"; var msg9 = "<%=labelBean.getLabel("MSG_REQUIRED_FIELD")%>"; var msg10 = "<%=labelBean.getLabel("MSG_WITH_EXACTLY")%>"; var msg11 = "<%=labelBean.getLabel("MSG_WITH_VALID_DATE")%>"; var msg12 = "<%=labelBean.getLabel("MSG_EXAMPLE_DATE")%>"; var msgNum11 = "<%=labelBean.getLabel("MSG_WITH_A_MINIMUM_VALUE_OF")%>"; var msgNum12 = "<%=labelBean.getLabel("MSG_WITH_A_MAX_VALUE_OF")%>"; var msgNum13 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_ROUND_INETEGER")%>"; var msgNum14 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_AT_MOST")%>"; var msgNum15 = "<%=labelBean.getLabel("MSG_DECIMAL_PLACES")%>"; var msgEnter = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_VALID")%>"; var errorMsg = "<%=labelBean.getLabel("MSG_LOWECASE_ALPHABET_ALLOWED")%>" var radioButtons = document.getElementsByName("radio"); for (var x = 0; x < radioButtons.length; x ++) { if (radioButtons[x].checked) { if(radioButtons[x].value=="1") { if (! validateTextEntry(form.chqNum, "<%=labelBean.getLabel("CHQNUM")%>" + " ", true,11,11, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg10) ) return false; if (! validateAlphabet(form.chqNum, "" + " ",1, msg2,"" )) return false; } else if(radioButtons[x].value=="2") { if (! validateTextEntry(form.chqNumFrom, "<%=labelBean.getLabel("CHQNUMFROM")%>" + " ", true,11,11, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg10) ) return false; if (! validateTextEntry(form.chqNumTo, "<%=labelBean.getLabel("CHQNUMTO")%>" + " ", true,11,11, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg10) ) return false; if (! validateAlphabet(form.chqNumFrom, "" + " ",1, msg2,"" )) return false; if (! validateAlphabet(form.chqNumTo, "" + " ",1, msg2,"" )) return false; if(form.chqNumFrom.value == form.chqNumTo.value){ alert("<%=labelBean.getLabel("MSG_CANNOT_SAME")%>"); return false; } } } } return true; } function show(id) { if (document.getElementById(id).style.display == 'none') { document.getElementById(id).style.display = 'block'; } } //--> <!-- function hide(id) { document.getElementById(id).style.display = 'none'; } </script> </head> <body onload="show('single')"> <form name="form" method="POST" action="<%=contextPath%>/ChequeStopServlet?tranx=confirm" dir="<%=lang.getDir()%>" > <table width="500" align="center"> <tr> <td align="left" colspan="3"> </td> </tr> <tr> <td align="left" colspan="3" class="mainHeader"><%=labelBean.getLabel("STOP_CHEQUE")%></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" class="subHeader"><%=labelBean.getLabel("CHQ_DETAIL") %></td> </tr> <tr> <td colspan="3"><div align="center"> <p class="statusError"> <%if(request.getParameter("error") != null) out.println(labelBean.getLabel(request.getParameter("error"))); else out.println("");%> </p> </div></td> </tr> </table><br /> <table width="500" align="center"> <tr> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("ACC_NUMBER")%></td> <td width="10" class="lbl">:</td> <td width="305" align="left"> <select size="1" name="accNum"> <% for (Iterator iter = chequeStopBean.getAccList().iterator(); iter.hasNext();) { ChequeDTO chqDto = (ChequeDTO)iter.next(); %> <option value="<%=chqDto.getAccNum()%>"><%=chqDto.getAccNum()%></option> <% } %> </select> </td> </tr> <tr> <td align="right"> <input type="radio" class="radioStyle" name="radio" value="1" onfocus="show('single');hide('multiple');hide('multiple1');return true;" checked="checked" > <%=labelBean.getLabel("STOP_SINGLE")%> </td> <td> </td> <td> <input type="radio" class="radioStyle" name="radio" value="2" onfocus="hide('single');show('multiple');show('multiple1');return true;"> <%=labelBean.getLabel("STOP_MULTIPLE")%> </td> </tr> <tr id="single"> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("CHEQUE_NUMBER")%></td> <td class="lbl"width="10">:</td> <td colspan="2" align="left"> <input name="chqNum" type="text" size="15"> </td></tr> <tr id="multiple" style="display: 'none'"> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("FROM_CHEQUE_NUMBER")%></td> <td class="lbl"width="10">:</td> <td colspan="2" align="left"> <input name="chqNumFrom" type="text" size="15"> </td></tr> <tr id="multiple1" style="display: 'none'"> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("TO_CHEQUE_NUMBER")%></td> <td class="lbl"width="10">:</td> <td colspan="2" align="left"> <input name="chqNumTo" type="text" size="15"> </td></tr> <tr> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("REASON")%></td> <td class="lbl" width="10" >:</td> <td colspan="2"> <select name="reason"> <option value="Lost"><%=labelBean.getLabel("LOST")%></option> <option value="Stolen"><%=labelBean.getLabel("STOLEN")%></option> <option value="Payment Cancellation"><%=labelBean.getLabel("PAYMENT_CANCELLATION")%></option> <option value="Others"><%=labelBean.getLabel("OTHERS")%></option> </select> </td> </tr> <br/> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" align="center"> <input class="button" type="submit" value="Next" onClick="return validateAndSubmit();" > </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" align="left" class="footer"><%=labelBean.getLabel("NOTE")%> </td> </tr> <tr><td colspan="3" class="footer"> <ul> <li><%=labelBean.getLabel("THE_ASTERISK")%></li> </ul> </td> </tr> </table> <jsp:include page="/Footer.jsp" /> </form> </body> </html> This is error for the first page.. This is picture that which i wan.. Thanks! Have a container set to an em height and need the get the scroll or overflow value. Basically need to know if text node inside container has content hidden below the height allowed. How do I get this?
Does anyone know where I could get a scroller similar to the one used in this recent news div? http://www.383project.com/ thanks! Hello All, How can i want to capture onscroll event in Javascript ? Thanks in advance. Hello, How can i get scroll bar position of body tag ? Thanks in advance. A div that moves the divs innerHTML with a scrollbar.
Good morning, I'm using the TDC JavaScript Ticker code and would like to have the data scroll from right to left. Code: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="sagscroller.css" /> <script type="text/javascript"> //Note- Below example by JavaScriptKit.com function tdcticker(){ tickerSet.MoveNext(); if (tickerSet.EOF) //if end of data's file tickerSet.MoveFirst() setTimeout("tdcticker()",9000); } function init(){ tickerSet=ticker.recordset tickerSet.moveFirst() setTimeout("tdcticker()",9000) } </script> <a href="" datasrc="#ticker" class="ticker" datafld="messageURL" style="width:260px; border:0px solid black;"> <span id="tickerDiv" datasrc="#ticker" datafld="MESSAGES" ></span> </a> <script type="text/javascript"> if (document.all) ticker.ondatasetcomplete=init </script> Thanks in advance! Hello, Could anyone plz recommend a script that adds a "move to top" box for our .php site similar to the one we have on our blog site: http://sand.greekconcierge.com/ many thanks, Andy I've started seeing this on a few pages and I'd like to add it to mine. I'd like to add a back to top button where it doesn't just jump right to the top, but acts like the user were actually using the scroll bar. here are some well done examples: http://www.javascriptkit.com/jsref/window.shtml and http://www.webdesignerheaven.com/ I like the first one better (where it shows an up arrow if you've scrolled far enough), and I found what I think is the javascript responsible (though I'm not sure if it's exact right to take it.) let alone, i'm not sure how i would even implement it yet. http://www.javascriptkit.com/jkinclu...ltopcontrol.js i've got a basic example working on my own site, I just don't know how to stop it, (right now it just keeps going and going even if i try to scroll back down.) i'd like to be able to tell if the user reached the top, then stop it, but from what I've looked, i can't find a way to check where exactly they are in my page. i figure, if i can get mine to stop, I can fancify it later with the image that shows if you've moved down and what not, right now I'd like to just stop it when it reaches the top. hello I have the Javasript , to Control the direction of Maarquee .. its very useful for any one , feel fre to use .. But not this why i'm here I need to Improve it , this code Has 4 Images , 1- on click Marquee Speeds up .. done 2- On click Marquee Slows Down .. done 3-On click Marque Go left .. done 4-On click Marque Do right .. done 5- On click Marque Scroll Up ............Needs Help to do it 6- On click Marquee Scroll Down .... Needs help to do it i want N# 5 , 6 done same way on clik on image to go up and down .. code PHP Code: <style type="text/css">a {text-decoration: none} a:link {color: black;}</style> <table style="width: 100%; direction: rtl; background-color: EBEBEC; border: 1px solid EBEBEC" cellspacing="3" cellpadding="3" class="style1"> <tr> <td style="width: 100px"> <img src="images/right_button.gif" title="Go Right" border="0" align="center" style="cursor:hand;" onclick="document.all.last_feed.direction='right';document.all.last_feed.start();"> <img src="images/left_button.gif" title="Go Left" border="0" align="center" style="cursor:hand;" onclick="document.all.last_feed.direction='left';document.all.last_feed.start();"> <img src="images/plus.gif" title="Speed Up" border="0" align="center" style="cursor:hand; " onclick="document.all.last_feed.scrollAmount=8;"> <img src="images/minus.gif" title="Slow Down" border="0" align="center" style="cursor:hand;" onclick="document.all.last_feed.scrollAmount=4;"> </td> <td style="font-family: tahoma; font-size: 0.75em"> <marquee id="last_feed" behavior="scroll" direction="right" scrolldelay="50" height="20" scrollamount="5" onmouseover="this.setAttribute('scrollamount', 0, 0); " onmouseout="this.setAttribute('scrollamount', 5, 0);" >Your Text here</marquee></td></tr></table> |