JavaScript - Ie Jump Vertical Scrolling!!!
Right so I have a popup window that when opened in any browser expect of course IE will open perfectly in the centre of the screen. However with IE it decides to jump to the top of the page, then is pushed back down to just show the popup at the bottom of the window.
Anyone got any idea how I can stop this? Using IE8. Code: function openPopup_JD(params){ var name = params.name; var blanket = params.blanket || true; var effect = params.effect || "fade" var afterOpen = params.afterOpen || ""; var width = document.getElementById(name).style.width; var height = document.getElementById(name).style.height; width = width.slice(0, -2); height = height.slice(0, -2); width = width * 1; height = height * 1; document.getElementById(name).style.left = getLeft_JD(width) + "px"; document.getElementById(name).style.top = getTop_JD(height) + "px"; //Create blanket if it doesn't already exist. if(!document.getElementById('blanket')){ var popupBlanket = document.createElement("div"); popupBlanket.id = 'blanket'; popupBlanket.style.display = "none"; popupBlanket.style.opacity = 0; popupBlanket.style.filter = 'alpha(opacity = 0)'; popupBlanket.style.backgroundColor = "#000"; popupBlanket.style.position = "absolute"; popupBlanket.style.zIndex = 9998; popupBlanket.style.top = "0px"; popupBlanket.style.left = "0px"; popupBlanket.style.width = "100%"; popupBlanket.style.height = getBlanketHeight()+"px"; document.body.appendChild(popupBlanket); } switch(effect){ //----------------------------------- //FADE IN //----------------------------------- case "fade": if(blanket == true){ animate_JD({ objects: 'blanket |'+name, properties: "opacity |opacity", start: "0", end: "0.75 |1", inerval: "20 |20", frames: "15 |20", effect: "SFS", wait: "0 |-1", onStart: "toggle('blanket') |toggle('"+name+"')", onComplete: " |"+afterOpen }); }else{ animate_JD({ objects: ''+name, properties: "opacity", start: "0", end: "1", interval: "20", frames: "6", effect: "SFS", wait: "0", onStart: "toggle('"+name+"')", onComplete: ""+afterOpen }); } break; Not all of the function is shown because below this are only other effects Similar TutorialsA little difficult to explain, but here goes: I've combined a couple different jquery scrollable functions to a webpage that I'm creating. This: http://flowplayer.org/tools/demos/sc...one-sized.html for my horizontal scrolling. And this: http://flowplayer.org/tools/demos/sc.../vertical.html for my vertical. The problem with the vertical scrolling function is that it relies on the mousewheel and mouse clicks for scrolling and I don't feel it's immediately apparent that the text scrolls. But I really like the effect, so I've added arrows and tried to get the functionality from the vertical scrolling example, but it's not working, except for the down arrow in the content in the very last tab. When you click on an arrow, it currently takes you to the previous or next horizontal section. I know the answer is in there somewhere, but I'm not sure where to look for it. Here's the javascript file that controls the functionality: http://www.chevalia.net/js/jquery.tools.min.js And the link to the page: http://www.chevalia.net/chevalia/index2.html The CSS for the scrollable: Code: #flowtabs { /* dimensions */ width:425px; height:31px !important; margin:0 !important; padding:0; /* IE6 specific branch (prefixed with "_") */ _margin-bottom:-2px; } /* single tab */ #flowtabs li { float:left; margin-left:7px; padding:0; text-indent:0; list-style-type:none; } /* a- tag inside single tab */ #flowtabs li a { display:block; height: 31px; padding:30px 12px 10px 0; margin:0px; /* font decoration */ text-align:center; text-decoration:none; } /* style for horizontal flow */ #flowpanes {height:468px; width:924px; position:relative; overflow:hidden; clear:both;} #flowpanes ul.items {width:20000em; position:relative; clear:both; margin:0; padding:0;} #flowpanes ul li {float:left; display:block; width:924px;} /* style for vertical flow */ /* root element for scrollable */ .vertical { /* required settings */ position:relative; overflow:hidden; /* vertical scrollers have typically larger height than width */ height: 450px; width: 611px; } /* root element for scrollable items */ .vert_items { position:relative; width: 600px; float:left; /* this time we have very large space for height */ height:5000em; margin: 0px; } .actions { width:15px; height:auto; float: right; margin:auto; } .actions a { cursor:pointer; } .nextPage { float:right; margin-top:38px; } .prevPage { float:right; margin-top:200px; } Anyone care to take a stab at this puzzle? Many thanks in advance. Hi, I need your help guys. I've got a little problem. I have some smileys which I enter to a textarea when clicking on them. It works perfect, but once the user clicks on a smiley, the focus goes off of the textfield. I use document.getElementById('message').value += smileycode It works perfectly, it enters the smileycode to the textarea. My problem is... When I say document.getElementById('message').focus() it goes back to where the cursors has last been so before the smileycode. Instead of this, I want the focus to go back after the insertion of the code. I hope it's understandable. And thanks in advance! I am using a Jump Menu: Code: function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } function MM_findObj(n, d) { //v3.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x; } function MM_jumpMenuGo(selName,targ,restore){ //v3.0 var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore); } Code: <form name="FrontPage_Form1" language="JavaScript" onsubmit="return FrontPage_Form1_Validator(this)"> <!--webbot bot="Validation" b-disallow-first-item="TRUE" --><select name="menu" class="TextArea" onchange="MM_jumpMenu('self',this,0)"> <option value="javascript:myVoid()" selected>Choose One </option> <option value="1.html">One</option> <option value="2.html">Two</option> </select> </form> Is there some way to make such a jump menu observe the history, so that going back will go back to the page containing the form? Hello all, I needs some help. I currently have a script to jump to an anchor tag when the page loads: Code: <script type="text/javascript"> function goToAnchor() { location.href = "myPage.html#myAnchor"; } </script> Now, I would like to take it a step further and would like to link from page A to page B that usually takes a while to load and once the page loads, run a script to jump to the specified anchor tag on the page after everything has loaded. I know I have to add some parameters at the end of the url link on page A, but that's where I get stuck. Can anyone please help? Hi all, I'm having problems with a javascript jump menu that uses two select form elements, where the first one enables the second one if the right option is picked. I've not much knowledge of javascript so I've basically combined two separate functions, but at the moment only the second menu redirects the user - I need the first menu to do this as well if the second option is selected. Any ideas?! Here's the code - many thanks in advance if you can help: Code: <html> <head> <script type="text/javascript"> function chooseSelect(selectOption) { document.getElementById('shape').disabled = (selectOption!=1); } function jumpMenu(select) { var i = select.selectedIndex; var selection = select.options[i].value; var url; if (i === 0) { alert("Please select an option"); } else { url = selection; location.href = url; } } </script> </head> <body> <form action="" method="get"> <select name="color" id="color" onChange="chooseSelect(this.value);"> <option value="">- Choose Color -</option> <option value="red.html">Red</option> <option value="1">Shape</option> </select><br /> <select name="shape" id="shape" disabled="disabled"> <option value="">- Choose Shape-</option> <option value="square.html">Square</option> <option value="circle.html">Circle</option> <option value="rectangle.html">Rectangle</option> </select><br /> <br /> <input type="button" value="GO" onclick="jumpMenu(this.form.shape);"> </form> </body> </html> Hello I need some help with Google Maps please. Im using Google Maps API V3. So I can create a simple map but what I need is to have two markers (which are quite far apart) on the map. For example these markers are called 'Marker 1' and 'Marker 2'. Below the map I would have 2 links called for example 'Marker 1 link' and 'Marker 2 link'. When the map loads, 'Marker 1' is visible and centered. Now to move to 'Marker 2' on the map, I would click the link under the map. And vice versa. A good example is http://arts.brighton.ac.uk/contact-u...aculty-of-arts I tried but failed when I tried this guys answer on this website: http://stackoverflow.com/questions/2...utside-the-map Any help to create this is greatly appreciated! Hi all, I am having trouble with the Form Validation I have on my wifes website...everything is working how it should it's just when you hit the submit button the screen jumps up about an inch or so putting the error message out of view....Is there anything that can be done to stop... Thanks all. if i have a large script built multi-select-list-box, is there a way within javascript to onClick of a hyperlink, jump-to the line within the select box that corresponds to the value clicked?
I am displaying a webpage from external domain in an iframe on my site. The webpage being shown in iframe has a header image that I would like to not appear when someone visits my site. Is it possible using Javascript or otherwise to have the iframe scrolled down by a certain pixels by default?
Hi, I want my page to jump to a different page based on data collected in the form input fields. I can jump to a new page alright, using the following javascript: 1. javascript code in form_a.html document.forms["form_A"].action = "page_x.html"l; document.forms["form_A"].submit(); 2. document.forms[0].action = "page_x.html"l; 3. window.locaton = "page_x.html"; 4. window.location.href = "page_x.html"; The problem is, I can see the new page was jumped to, but immediately it return back to the page that trigger the jump. Any idea? I need to finish the project before Christmas. Any help is greatly appreciated! Jeff Hi, I'm looking to create a div which contains a list of news items which can be vertically scrolled through by hovering near the top or the bottom of the div. It will then automatically start scrolling through the content. The nearer to the bottom of the div they position their mouse, the faster the scrolling is. Is this something which is possible, and if so how can I do this? Thanks Curt Hello. I am in the process of making a basic game board using javascript. Just a table with a bunch of cells that are blank, soon to be colored. However, what I want to do is create my board and be able to scroll depending on where the mouse cursor is. For example, if it is 100px away from the right side of the screen, then move the board to the right. I am trying to use the information from: here I can't seem to get it to work. I have checked firebug, set and checked breakpoints, but it never moves and I am not sure why. Could anyone please help? Thank you. Heres my code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style> #land { table-layout: fixed; width: 2500px; height: 2500px; } #land td { width: 25px; height: 25px; border: 1px solid black; empty-cells:show; } #land tr { height: 25px; } </style> <script type="text/javascript" src="World/world.js"></script> <script type="text/javascript" src="mapscrolling.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body id="mainBody"> <div id="mainDiv"> </div> <script type="text/javascript" > new CursorDivScroll( 'mainDiv', 20, 20 ); // HERES THE REFERENCE! var i, j; body = document.getElementById("mainDiv"); land = document.createElement("table"); land.setAttribute("id", "land"); land.setAttribute("cellspacing", "0"); land.style.border = "1"; for(i = 0; i < 100; ++i) { var row = document.createElement("tr"); for(j = 0; j < 100; ++j) { var cell = document.createElement("td"); cell.appendChild(document.createElement("div")) // tried &nsbd; but didn't work row.appendChild(cell); } land.appendChild(row); } body.appendChild(land); </script> </body> </html> Hi there, I was wondering of there is any way to have a browser window scroll down when your mouse reaches the bottom of the page? Any help would be much appreciated, Thanks +++ is it possible to scroll / jump to say, 10px above a div? i tried adding padding, but it doesn't work. also, when I use <a href="#xxxx">, is it possible to prevent the browser from adding #xxxx to the url in the browser? thanks!!! +++ I need help adding an auto scrolling feature (such as this http://www.brownielocks.com/autoscroll1.html) to an object on my website (see www.mymcgillmisa.com) I've tried (with no results) to get it to scroll, but maybe some experienced coders can help Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head><title></title></head><body><div style="width:320px; height:360px; overflow:auto;"> <p style="font: 13pt/20pt Garamond, Georgia, serif;color:#191919;"> <b> NEWS AND ANNOUNCEMENTS</b> </p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>WELCOME BACK </b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> MISA has big plans for you this year, so stay tuned and check back here often. We plan on keeping you as up to date as possible with events relevant to you this year.</p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>MISA Rep Selection 09</b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>3</b> representatives will be chosen by the executive council for each year (U1, U2, & U3) , if you are interested in applying please check your McGill e-mail or <a href="http://www.sendspace.com/file/60yyn4">click here</a> for information.</p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>Intramural Sports Teams</b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> The possible teams a Basketball, Ball Hockey, Dodgeball, Flag Football, Ice Hockey, Outdoor Soccer, Ultimate, & Volleyball. Teams will be formed based on the number of people interested. Please send an email from your McGill email to <a href="mailto:mimmsports@gmail.com">mimmsports@gmail.com</a> with a subject header of the sport (s) you wish to play. All requests must be sent in by Friday September 11th to be considered.</p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> <b>ROYAL FLUSH:</b></p> <p style="color:#191919; font-style:normal; font-variant:normal; line-height:20pt; font-size:13pt; font-family:Garamond, Georgia, serif"> Casino night fundraiser for the Crohn's and Colitis Foundation of Canada at Suco on St-Laurent on <b>Sept 11 @ 9PM </b> feat. DJ Alexei Sopin, Burlesque and Sexy Bollywood dancers, poker, blackjack, roulette, and prizes! Cocktail Dress Code. <a href="http://www.royalflush.yolasite.com">www.royalflush.yolasite.com</a> (20$)</p> </div></body></html> Any help would be appreciated thanks Hi, I have the following scrolling table where I do not want the table headers to scroll. I want only the data inside <td></td> to scroll. For some reason that is not happening. Can someone help ? Really appreciate that. Regards, sbguy [CODE] <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Page</title> <script type="text/javascript"> var div, scrollTop, scrollID, direction, imgDirection, scrollID1; window.onload = function() { div1 = document.getElementById("div1"); scrollTop = div1.scrollTop; }; function scrollOnImage() { if (imgDirection ==1 ) { if (scrollTop != 0) scrollTop--; } else if (imgDirection == 2) { if (scrollTop != (div1.scrollHeight - 300)) scrollTop++; } div1.scrollTop = scrollTop; scrollID1 = setTimeout("scrollOnImage()", 10); } </script> </head> <body> <br /> <div style="border: solid 1px red; float: left; height:300px; max-height:300px; width:200px; overflow: hidden;" > <table> <tr> <th style="height:20px;"><input type="image" src="images/LGbtn_off.png" alt="img1" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=1; scrollOnImage()" /></th> <th>1A</th> <th ><input type="image" src="images/RRbtn_off.png" alt="img2" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=2; scrollOnImage()" /></th> </tr> <tr> <td colspan="3" style="height:280px; max-height:280px;"> <div id="div1"> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1234</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1235</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> <ul id="ulR_1A" class="ulli"> <li><span class="li_head">PCode:</span> 1236</li> <li><span class="li_head">Product:</span> GX12x24 Medium Large 80</li> <li><span class="li_head">Qty:</span> 256</li> <li><span class="li_head">Batch No:</span> 01AC950</li> <li><span class="li_head">Manf Date:</span> 11/08/2012</li> <li><span class="li_head">SS Date:</span>11/07/2013</li> <li><span class="li_head">Total Pals:</span> 60</li> <li><span class="li_head">Pals Occupied:</span> 59</li> <li><span class="li_head">Bin Occupancy:</span> 89%</li> <li><span class="li_head">Trn No:</span> 1234567890</li> <li><span class="li_head">Bin Status:</span> Part Full</li> </ul> </div> </td> </tr> </table> </div> <div style="border: solid 1px red; float: left"> <img src="http://www.easyvoyage.co.uk/base/imgs/default/esv/meh/upDownArrow.png" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=1; scrollOnImage()" /><br /><br /> <img src="http://www.easyvoyage.co.uk/base/imgs/default/esv/meh/downUpArrow.png" onMouseOut="clearTimeout(scrollID1)" onMouseOver="imgDirection=2; scrollOnImage()" /> </div> </body> </html> [CODE] hey guys i have graphic on the right side of the screen that is not in view and i am scrolling it to the left. Is there away to remove the bottom scrollbar permanently through using a mask or something. if i have an item scrolling from the left the scroll bar does not show, but on the right it does. an help be appreciated. Hi, I know that iframes can be set to have scroll bars automatically apear when needed or put them there permanantly. However, I would like to have a Javascript slider on the topmost page scroll the iframe. It was possible to make a link on the topmost page change the content of the iframe by putting the iframe name in the link's target. Is this possible with a slider? I ask this because some of the content inside the iframe is on external pages so obviously we can't add the scroll bar there. hey, basically, on my blog i have a "load more" button at the bottom which works great. it uses AJAX to pull in the additional content. now, i want to keep that button, but I also want it to automatically load this content when you scroll to the bottom of the page (endless scrolling - like you see on a lot of sites). so far this is my code. I'm really knew to jquery so I'm sure the problem is obvious to you guys, but please be kind haha. #article_wrapper contains all the blog posts. #loaded contains the new ones that are loaded in with AJAX. #older_posts is the load more button. #load_more is a div around the load more button. thanks! Code: $(window).scroll(function(){ if ($(window).scrollTop() == $(document).height() - $(window).height()){ $('#articles_wrapper').append("<div class='loaded'></div>"); $('div.loaded:last').load(url); var last = $('div.loaded:last ul'); if (last.is(':empty')) { $('#older_posts').remove(); } url="/ajax/content_load.php" + $('#older_posts').attr('href') + " #load_more"; $('#older_posts').load(url); return false; } }); This is what i need to do: I have a single <DIV> </DIV> for rendering dynamic HTML content. it already has a scrollbar in it when it overflows with text. I want to be able to prevent the user from selecting text on the DIV, and at the same time, when they click on the DIV and drag the mouse up or down , the HTML document will be scrolled proportionally to the dragging. i would also like to Hide the Scrollbar (not disable it). any suggestions? |