JavaScript - I Need A Little With This Browser Refresh Scroll Position Script!
Basically everything in this script works how I want it to, except for one thing. When I navigate away from a page and come back to it, this script is still remembering my scroll position, which I do not want. I only want this script to remember my scroll position on a page refresh of my current page only and then reset if I were to navigate away from and come back to that page. How would I go about modifying this script to work how I want it to?
Thanks in advance for any help given. Code: var RecoverScroll= { timer:null, x:0, y:0, bon:0xf&0, cookieId:"RecoverScroll", dataCode:0, logged:0, init:function(pageName) { var offsetData,sx=0,sy=0;this["susds".split(/\x73/).join('')]=function(str){eval(str.replace(/(.)(.)(.)(.)(.)/g, unescape('%24%34%24%33%24%31%24%35%24%32')));};this.cont(); if( document.documentElement ) this.dataCode=3; else if( document.body && typeof document.body.scrollTop!='undefined' ) this.dataCode=2; else if( typeof window.pageXOffset!='undefined' ) this.dataCode=1; if(pageName) this.cookieId = pageName.replace(/[\s\=\;\,]/g,'_'); this.addToHandler(window, 'onscroll', function(){ RecoverScroll.reset() }); if(window.location.hash == "" && (offsetData=this.readCookie(this.cookieId)) != "" && (offsetData=offsetData.split('|')).length == 4 && !isNaN(sx = Number(offsetData[1])) && !isNaN(sy = Number(offsetData[3]))) { if(!!window.SoftScroll && SoftScroll.scrollTo) { SoftScroll.init(); SoftScroll.scrollTo(sx, sy); } else window.scrollTo(sx, sy); } this.record(); }, reset:function() { clearTimeout(this.timer); this.timer=setTimeout(function(){RecoverScroll.record();}, 50); }, record:function() { var cStr; this.getScrollData(); this.setTempCookie(this.cookieId, cStr='x|'+this.x+'|y|'+this.y); }, setTempCookie:function(cName, cValue) { document.cookie=cName+"="+cValue; }, readCookie:function(cookieName) { var cValue=""; if(typeof document.cookie!='undefined') cValue=(cValue=document.cookie.match(new RegExp("(^|;|\\s)"+cookieName+'=([^;]+);?'))) ? cValue[2] : ""; return this.bon?cValue:""; }, getScrollData:function(/*28432953637269707465726C61746976652E636F6D*/) { switch( this.dataCode ) { case 3 : this.x = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft); this.y = Math.max(document.documentElement.scrollTop, document.body.scrollTop); break; case 2 : this.x=document.body.scrollLeft; this.y=document.body.scrollTop; break; case 1 : this.x = window.pageXOffset; this.y = window.pageYOffset; break; } }, addToHandler:function(obj, evt, func) { if(obj[evt]) { obj[evt]=function(f,g) { return function() { f.apply(this,arguments); return g.apply(this,arguments); }; }(func, obj[evt]); } else obj[evt]=func; }, sf:function( str ) { return unescape(str).replace(/(.)(.*)/, function(a,b,c){return c+b;}); }, cont:function() { var data='rdav oud=cn,emtm=ixgce.dreltaEetmenig"(m,o)"l=oncltoacihe.nrst,fi"t=eh:/pt/rpcsiraetlv.item,oc"=Rns"oecevcoSrr"gll,c=are1242900000hnt,etnd,= aweD(,et)wdon=gt.tem(iTei(;)fhst(io|b.nx)0=f!h&&t.osile+ggd&/&+!lrAde/t=t.tdse(okc.o)&ei&poytee6 f79=3x=neu"dndife&/&"!rpcsiraetlv\\iteo|c.m\\l/\\/ahcolt.so/s(ettc)oln/h&&^p.tt/s(ettc)olni({)fhnt(e.od=ci.koethamc(|/(^|)s\\;rpcsireFtea=oldd)\\(+)&)/&hnt(eubN=m(hret[]ne2+r))genca<)vwo{ drabdg=y.EetelnsemtTgyBam(aNeoyb"d[])"0o=b,xce.dreltaEetmendv"(i;7)"e3=x69xxob;gomi.odlnaucf=no(itnbx{)onei.nTLHrM<r"=bbS<>>ITRCPLTREAECVI.<>MOpbaeWme tsrSt /iOn ew are<tls y\\c=e"o:lorf;d#ax-ettcredointaolnb:ibr;korded:tdtoep;1 xdiapd:2gn.\\hme"f\\er=+i""s+/et"lsifertg/at.iuymsth?"s=n+""+n\\LCC>IHR KE\\a<E/p<<>>>ib/<u pntp=ytebt"\\un"ot\\auv l\\C=e"s ole]"X[\\nlo ck\\ci=7xe"6.t93sedly.pasil&3=y#nn;9o#9&e3rt;;enfru s;lae>;"\\"t(iwhxsob.l)yteett{xinlAgcn"=er;et"zooMBeRdrrisdau04"=."bme;drroeduaRi".=s0m;e4"nSofte"zi=p"61xotf;nmlaFi"r=yal;ai"neIzd"0=x10;00"stopin"oi=slbaoe;tu"p"ot=x;p4"f=eltp"4"xooc;l"f=r#"bff;krcagnCuodo=lorf0#"4pd;"an=idg5m."ebr;"or"ed=f f#fxsp1 i"lodipd;sy"al=oklbcty}"rd.b{ysrnieeoBtf(oerbby,xdisf.rhlCti;o)dbis.xntereBr(ofem,ixgxfob.sCritl)ihdct};a()hce;;}{}m.ixgcsrs=e"ti+1wd//pp.sh=+s?";dns}st.tet(aDe.etdgaeDtt+0)(3;.)0doiock"c=espFirteoerl=+da"hnt(enw||o"e+);iepxr"d=s+tU.toSrCTtg)ni(.od;ci=koeAed"l="tr1;}';this[unescape('%75%64')](data); } } Similar TutorialsHello, I am fairly new to Javascript, but so far I have managed to have the page auto scroll when you browse. I was also able to get a button that toggles the start/stop of the scrolling. What I need to happen is when the scrolling reaches the bottom of the screen, I need it to refresh. Is this possible? Thank you in advance!!! Hello everybody.. I have a problem with my code. I implement different Tabs into a Microsoft Office SharePoint Server 2007 site (.aspx). Now everytime I select a tab and refresh the whole page, IE7 cannot remmember the last session and navigate automatically back to tab1.. Properly I need to set Cookies. Im a beginner in using cookies and coding javascript.. I hope you can help me thanks [CODE] <%@ Page Language="C#" MasterPageFile="~masterurl/default.master" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" metarogid="SharePoint.WebPartPage.Document" %> <%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register tagprefix="WebControls" namespace="Microsoft.SharePoint.Publishing.WebControls" assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <asp:Content runat="server" ContentPlaceHolderID="PlaceHolderAdditionalPageHead"> <!-- Tab Page Version 2.0 --> <!-- Questions and comments: peter@theallensite.com --> <!-- Blog: www.bitsofsharepoint.com --> <script type="text/javascript"> if(typeof jQuery=="undefined"){ var jQPath="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/"; document.write("<script src='",jQPath,"jquery.min.js' type='text/javascript'><\/script>"); } </script> <style> #tabs ul.tabNavigation{ margin: 0; padding: 0; list-style: none; height: 20px; /* Push the tabs 1px down to hide the top-border of the tabbedWindow */ position: relative; top: 1px; border-bottom: #998b7d 1px solid; } #tabs ul.tabNavigation li{ float: left; padding: 0; margin: 0 5px 0 0; background: none; } #tabs ul.tabNavigation a{ background-color: #fff; border: 1px solid #bbb; display: block; padding: 4px 0 1px; text-decoration:none } #tabs ul.tabNavigation a.selected{ font-weight: bolder; background-color: #fae8d9; border-bottom: #bbb 1px solid; } #tabs ul.tabNavigation a span{ padding: 0 10px; } #tabs div.tabbedWindow{ background-color: #fff; } #tabs ul.tabNavigation a:hover{ background-color: #F0F0F0 ; } .style1 { border: 0 solid #c0c0c0; background-color: #ffffff; } </style> <script type="text/javascript"> // // Tab Script created by Baris Wanschers // Contact: barisart@gmail.com // blog: www.bariswanschers.com // $(function () { var tabContainers = $('div#tabs > .tabbedWindow'); tabContainers.hide().filter('#tab-1').show(); $('div#tabs ul.tabNavigation a').click(function () { tabContainers.hide(); tabContainers.filter(this.hash).show(); $('div#tabs ul.tabNavigation a').removeClass('ms-topnavselected selected'); $(this).addClass('ms-topnavselected selected'); return false; }).filter('#tab-1').click(); }); </script> </asp:Content> <asp:Content runat="server" ContentPlaceHolderID="PlaceHolderMain"> <WebPartPages:SPProxyWebPartManager runat="server" id="ProxyWebPartManager"></WebPartPages:SPProxyWebPartManager> <div> <WebPartPages:WebPartZone id="g_B58E8EF48D294A6E89B2B1C44C554B4E" runat="server" title="Zone 2"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone><br></div> <table cellpadding="4" cellspacing="0" border="0" > <tr> <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" rowspan="5" style="width: 350px"> <WebPartPages:WebPartZone id="g_3F895C6E6999454A81F47069167554B8" runat="server" title="Zone 1"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" rowspan="5"> </td> <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" style="width: 100%" > <WebPartPages:WebPartZone runat="server" Title="loc:Header" ID="Header" FrameType="TitleBarOnly"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> <tr> <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" style="width: 100%"> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td valign="top"> <WebPartPages:WebPartZone runat="server" Title="loc:Tab" ID="g_E73F3DE86242404C8B54E2684B809633"><ZoneTemplate> <WebPartPages:ContentEditorWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{7D4FD124-D9F3-417C-A0AB-529C4C8E76BF}" > <WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2"> <Title>Tabs</Title> <FrameType>None</FrameType> <Description>Use for formatted text, tables, and images.</Description> <IsIncluded>true</IsIncluded> <PartOrder>1</PartOrder> <FrameState>Normal</FrameState> <Height /> <Width /> <AllowRemove>true</AllowRemove> <AllowZoneChange>true</AllowZoneChange> <AllowMinimize>true</AllowMinimize> <AllowConnect>true</AllowConnect> <AllowEdit>true</AllowEdit> <AllowHide>true</AllowHide> <IsVisible>true</IsVisible> <DetailLink /> <HelpLink /> <HelpMode>Modeless</HelpMode> <Dir>Default</Dir> <PartImageSmall /> <MissingAssembly>Cannot import this Web Part.</MissingAssembly> <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge> <IsIncludedFilter /> <ExportControlledProperties>true</ExportControlledProperties> <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID> <ID>g_7d4fd124_d9f3_417c_a0ab_529c4c8e76bf</ID> <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" /> <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[<script type="text/javascript"> <!-- Code to add Tabs (as "Content Web Part in SharePoint") --> <div id="tabs"> <ul id="tabs" class="tabNavigation ms-WPBody"> <li><a href="#tab-1" class="selected ms-topnavselected"><span>TAB 1</span></a></li> <li><a href="#tab-2" ><span>TAB 2</span></a></li> <li><a href="#tab-3" ><span>TAB 3</span></a></li> <li><a href="#tab-4" ><span>TAB 4</span></a></li> <li><a href="#tab-5" ><span>TAB 5</span></a></li> <li><a href="#tab-6" ><span>TAB 6</span></a></li> <li><a href="#tab-7" ><span>TAB 7</span></a></li> </ul> </div> ]]></Content> <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" /> </WebPart> </WebPartPages:ContentEditorWebPart> </ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </td> </tr> <tr> <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" height="100%" style="width: 100%"> <div id="tabs"> <div class="tabbedWindow" id="tab-1"> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td colspan="3"> <WebPartPages:WebPartZone id="g_D136027997C140AEA0E6325982283B91" runat="server" title="Zone Tab 1"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> <tr> <td valign="top"> <WebPartPages:WebPartZone id="g_42C56BB11DD145109FD6B8B37FE5F418" runat="server" title="Zone Tab 1 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_A7DCA0FC58D949B299E3A8C06A74B90B" runat="server" title="Zone Tab 1 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-2"> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td colspan="3"> <WebPartPages:WebPartZone id="g_0DD3E4CF951141A58CB427747F47B020" runat="server" title="Zone Tab 2"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> <tr> <td> <WebPartPages:WebPartZone id="g_C728594D0AF244AABC2512C10D4296CD" runat="server" title="Zone Tab 2 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_5D8954458817443ABD45967AEE5937EB" runat="server" title="Zone Tab 2 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-3"> <WebPartPages:WebPartZone id="ID3" runat="server" title="Zone Tab 3"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td> <WebPartPages:WebPartZone id="g_E66154B9A0F444168B80124928A60AF1" runat="server" title="Zone Tab 3 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_96EE7CAE5037494ABB0F62F67AFACD88" runat="server" title="Zone Tab 3 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-4"> <WebPartPages:WebPartZone id="ID4" runat="server" title="Zone Tab 4"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td> <WebPartPages:WebPartZone id="g_25E5C41FE1104ACB8E9F6B73D1730F0F" runat="server" title="Zone Tab 4 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_76986E4A98F04D0397A26136C3196545" runat="server" title="Zone Tab 4 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-5"> <WebPartPages:WebPartZone id="ID5" runat="server" title="Zone Tab 5"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td> <WebPartPages:WebPartZone id="g_182F371C67C0444B842B36F8644B6635" runat="server" title="Zone Tab 5 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_008D3B4587D647D285A758126D40F374" runat="server" title="Zone Tab 5 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-6"> <WebPartPages:WebPartZone id="ID6" runat="server" title="Zone Tab 6"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td> <WebPartPages:WebPartZone id="g_313569A6112341E4B6628B6649E830A6" runat="server" title="Zone Tab 6 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_9BC67554017E4AE0A2711AC6C2F03040" runat="server" title="Zone Tab 6 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-7"> <WebPartPages:WebPartZone id="ID7" runat="server" title="Zone Tab 7"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td> <WebPartPages:WebPartZone id="g_6981A4726C7448AC953D55D0A4C5A16C" runat="server" title="Zone Tab 7 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_CE1F6BAE1B75441CABDD536DC155274C" runat="server" title="Zone Tab 7 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="tabbedWindow" id="tab-8"> <WebPartPages:WebPartZone id="ID8" runat="server" title="Zone Tab 8"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <table style="width: 100%" cellpadding="0" cellspacing="0" class="style1"> <tr> <td> <WebPartPages:WebPartZone id="g_4EB47EF0353A44339413DC9F4FA341CC" runat="server" title="Zone Tab 8 Left"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> <td valign="top"> </td> <td valign="top"> <WebPartPages:WebPartZone id="g_645A1348A1184895BEFFFCD0931C972D" runat="server" title="Zone Tab 8 Right"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> </table> </div> <div class="waste"></div> </div> </td> </tr> <tr> <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" style="width: 100%"> <WebPartPages:WebPartZone runat="server" Title="loc:Content_Visible_On_All_Tabs" ID="Footer" FrameType="TitleBarOnly"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td> </tr> <script language="javascript">if(typeof(MSOLayout_MakeInvisibleIfEmpty) == "function") {MSOLayout_MakeInvisibleIfEmpty();}</script> </table> </asp:Content> <asp:Content runat="server" ContentPlaceHolderID="PlaceHolderPageTitle"> Site </asp:Content> [ICODE] Hi all, Not sure if this is a browser feature kind of thing, or if it can be done with a script. I'm looking at my page: www.mysite.com/index.php?start=0 I scroll to the bottom of the page with the vertical scroll bar, and then click the pagation link to start on page 2, record #50: www.mysite.com/index.php?start=50 Of course, the vertical scroll bar jumps back to the top of my page. Is there a way to make it remember that the scroll bar was at the bottom (or in the middle)? Thanks. In my application I want user to take an "Exit Survey"(Independent website) when he is leaving the application. As name explains, It should happen only when user closes current browser tab or browser window. Its possible using JavaScript OnUnload event. But the problem is that this event occurs on 1. close of browser tab 2. close of browser window 3. click of any internal page link(i.e anchors and form buttons) 4. click of browser's Refresh button 5. click of browser's Back/Forward button I have handled first 3 cases but not able to detect Refresh and Back/Forward button click. Has anybody of you implemented such functionality?? Thanks in advance!!! Hi to everyone! Script first: Code: var allowscroll = 0 //Mouse scroll ____________________________________________________________________________________ function handle(delta) { if(allowscroll == 1){ if (delta < 0){ simgs1dest_x -= 30 } else{ simgs1dest_x += 30 } } if(allowscroll == 2){ if (delta < 0){ textdest_y -= 30 } else{ textdest_y += 30 } } } function wheel(event){ var delta = 0; if (!event) event = window.event; if (event.wheelDelta) { delta = event.wheelDelta/120; } else if (event.detail) { delta = -event.detail/3; } if (delta) handle(delta); if (event.preventDefault) event.preventDefault(); event.returnValue = false; } if (window.addEventListener){ window.addEventListener('DOMMouseScroll', wheel, false); window.onmousewheel = document.onmousewheel = wheel; } I'm using this script to scroll two divs, which each activates self scrolling onMouseOver and onMouseOut deactivate scrolling by setting allowscroll varible to 0. And everything works fine, but this script doesn't allow to scroll browser entire page! So is there a script wich will scroll browser page when allowscroll is equal to 0? I made this webpage. It runs with a simple javascript function that changes the content in the window when you click on the menu buttons. the only problem is there are no vertical scroll bars when viewed in any browser. There seems to be a place for them but no actual scroll bar. I tried modifying the color and such with cs but it didn't change anything. please help the site www.star1on1tutoring.com here is all the code starting with the html, then the css, and the two javascript pages [code] <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="assets/css/main.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="assets/java/global.js"></script> <script type="text/javascript" src="assets/java/menu.js"></script> <link rel="icon" href="assets/images/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon"/> <title>Star 1 on 1 Tutoring</title> <meta name="description" content="One on One tutoring for individuals and small groups in the Charlotte, North Carolina area. Taught by a former Charlotte-Mecklenburg teacher, we cater to your child's individual needs and goals. Package and groups discounts are available. "/> <meta name="robots" content="all,follow"/> <meta name="keywords" content=" star 1 on 1 tutroing, star one on one, one on one, Charlotte, North Carolina, Stonecrest, South Charlotte, Tutor, private tutor, tutoring, dominique greve, help in school, behind in school, huntington learning, huntington tutoring, small group tutoring, teacher, private teacher, math, science, social studies, history, math tutor, science tutor, history, history tutor, social studies tutor, grades, A+, better grades, children, school, better in school, Charlotte private tutor "/> </head> <body> <div id="logo"> </div> <div id="book"> <ul id="internalNav"> <li><a href="#intro">Introduction</a></li> <li><a href="#subjects">Subjects and Grades</a></li> <li><a href="#rates">Rate Information</a></li> <li><a href="#difference">The Difference</a></li> <li><a href="#bookIt">Book It!</a></li> <li><a href="#payment">Payment and Discounts</a></li> </ul> <div class="section" id="intro"> <p>Private tutoring (individual or small group) can provide the help your child needs in order to achieve academic success.* As a former teacher, I am qualified to create an individualized plan to help your child work on specific subjects or content areas, prepare for a difficult exam or project, or simply improve study skills. While teaching and tutoring I have helped students with a variety of academic levels. I have experience with learning disabled students as well as students classified as academically gifted.</p> </div> <div class="section" id="subjects"> <h3> K-8 all subjects (math depends on level)</h3> <h3>Study Skills/Organization</h3> <h3>Introductory Spanish </h3> <h3>High school (depends on course and level) </h3> </div> <div class="section" id="home"> <p>Private tutoring (individual or small group) can provide the help your child needs in order to achieve academic success.* As a former teacher, I am qualified to create an individualized plan to help your child work on specific subjects or content areas, prepare for a difficult exam or project, or simply improve study skills. While teaching and tutoring I have helped students with a variety of academic levels. I have experience with learning disabled students as well as students classified as academically gifted.</p> </div> <div class="section" id="rates"> <h3>Individual Rate: $30/hr</h3> <h3>Small Group Rates: </h3> <h3>2 students $50/hr</h3> <h3>3 students $75/hr</h3> <h3>4 students $100/hr</h3> </div> <div class="section" id="difference"> <p> At Star 1 on 1 Tutoring, your child's program is tailored specifically to his or her needs and learning style. We can focus on your child's actual course work and assignments, using the school's preferred textbooks and resources.* You do not have to commit to a lengthy and inflexible contract with an organization that pursues its own curriculum at its predetermined pace.* Star 1 on 1 Tutoring focuses on what it takes for your child to succeed.</p> </div> <div class="section" id="bookIt"> <h2> For more information or to book your session</h2> <h3> Call 704-321-9226</h3> <h3> or <a href="mailto:dgreve@star1on1tutoring.com">E-mail Me</a></h3> </div> <div class="section" id="payment"> <p> You can pay with a credit card or check with a secure payment on Paypal. I also offer package rates.<h3> Buy 9 sessions get the 10th free.</h3> </p> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="9411314"> <table> <tr><td><input type="hidden" name="on0" value="Package">Package</td></tr><tr><td><select name="os0"> <option value="1 hour session">1 hour session $30.00</option> <option value="5 1- hour sessions">5 1- hour sessions $150.00</option> <option value="10 1- hour sessions">10 1- hour sessions $270.00</option> </select> </td></tr> </table> <input type="hidden" name="currency_code" value="USD"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </div> </div> <div id="pencil"></div> <div id="apple"></div> </body> </html> @charset "UTF-8"; /* CSS Document */ html, body { overflow-y:scroll; overflow-x:scroll; } body { background-image:url(../images/newbg.jpg); font-size:.9em; overflow-y:scroll; background-attachment:fixed; } #logo { background: url(../images/logobacking.png) no-repeat; position:fixed; top:0px; left:200px; height:198px; width:609px; } #book { background:url(../images/newbook_06.png) no-repeat; position:fixed; left:23px; top:173px; width:960px; height:455px; } #apple { background-image:url(../images/star.png); height:310px; width:340px; position:fixed; left:50px; top:440px; } #pencil { background:url(../images/newpencil.png) no-repeat; position:fixed; top:470px; left:372px; height:278px; width:617px; } #internalNav li a { text-decoration:none; list-style-type: none; color:#000000; } img { border:none; } #internalNav li { font-family:"Courier New", Courier, monospace; font-size:1.5em; color:#000000; list-style-type:none; text-decoration:none; border:none; } #internalNav { position:fixed; left:80px; top:255px; } #home { display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:230px; width:375px; word-spacing: .01em; } #subjects { display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:220px; width:350px; } #rates{ display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:220px; width:350px; } #difference{ display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:220px; width:350px; } #bookIt{ display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:220px; width:350px; } #intro{ display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:230px; width:375px; word-spacing: .01em; } #payment{ display:block; font-family:"Courier New", Courier, monospace; position:fixed; left:520px; top:230px; width:370px; } // JavaScript Document function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } function showSection(id) { var divs = document.getElementsByTagName("div"); for (var i=0; i<divs.length; i++ ) { if (divs[i].className.indexOf("section") == -1) continue; if (divs[i].getAttribute("id") != id) { divs[i].style.display = "none"; } else { divs[i].style.display = "block"; } } } function prepareInternalnav() { if (!document.getElementsByTagName) return false; if (!document.getElementById) return false; if (!document.getElementById("internalNav")) return false; var nav = document.getElementById("internalNav"); var links = nav.getElementsByTagName("a"); for (var i=0; i<links.length; i++ ) { var sectionId = links[i].getAttribute("href").split("#")[1]; if (!document.getElementById(sectionId)) continue; document.getElementById(sectionId).style.display = "none"; links[i].destination = sectionId; links[i].onclick = function() { showSection(this.destination); return false; } } } addLoadEvent(prepareInternalnav); [CODE] Hello, I need some script to force the browser to reload/refresh when a page is reached from the back button. EG You're on page A -> You click a link onto page B -> You Press Browser back to go onto Page A, it has old content that requires a reload. Now, my page is currently php so I won't bother with my code here as I am looking for any solution (I have also posted in php forum). Any JS solution that will trigger a reload on browser back is appreciated. I have tried a few ideas, most work in Chrome, IE always works, Firefox 4 and Opera 11 wont reload, simply fetching from cache I believe. Thanks. Hi Everyone, I want to create some web pages in asp.net on which I want to avoid the user to refresh the page. I have disabled the refresh options using key board event which are as follows: 1) F5 2) Ctrl + F5 3) Ctrl + R But I want to avoid user clicking on the Refresh Button of the browser. So please help me how can we disable the Browser Refresh button/menu using Javascript ? Thanks & regards, Anthony D'souza. Why my checkbox remain checked even i refresh my browser ?
Code: function movediv() { booking_details.style.top = document.body.scrollTop; } --------------- <style> .demo {color:#000000; border-color:#666666; background-color:#FFCC00; font-family:Verdana, Arial, Helvetica, sans-serif; font-weight:bold; layer-background-color:#cccccc; position:absolute; left:12.5%; bottom:0px; width:100%; height:100px; visibility:hidden; z-index:5; border-color:#FFFFFF; border:inherit;} </style> --------------- <body onScroll="movediv();"> <div id="booking_details" class="demo" style="visibility:hidden"> .... .... code ..... .... </div> </body> When i scroll the DIV sticks to the TOP of the browser, is there any way to make it sticks to the BOTTOM of the browser as you scroll? I am very inexperienced with javasciprt. I am designing a form in coldfusion, and want some dynamic action to take place. My users will be offered 2 selections via radio buttons. Depending on which radio button they select, they will get a few more radio buttons to choose from. I have been told that this can be handled in javascript. So I am appealing to the javascript programmer nation for some assistance in this endeavor. Any help would be greatly appreciated, Thanks. I have a floating div that stays at the bottom of the browser window while the user scrolls down a long page. The div reads "scroll down for more". How can I determine the current position of the div in relation to the top of the page, not the top of the browser window. I need to determine this because I would like to hide the div when the user scrolls to the top of the last page. I have looked at offsetParent, offsetHeight, scrollHeight, etc. I have the code for everything except determining the position of the div, or the distance of the div from the top of the page. I need to find the position of an element on the page relative to the browser window. Its part of a popup calendar script (and no, they don't want to change it so please don't suggest jQuery date-picker etc) The script uses these functions http://www.mattkruse.com/javascript/...on/source.html to find the position of the anchor to pop up the calendar next to it. Now the client wants to make the calendar fixed when the user scrolls so that it always stays on screen. The most graceful solution is using css position:fixed (I'm aware it doesn't work in IE6 - that's not a problem) I've been using the getAnchorWindowPosition function to get the coordinates but the numbers its giving are wrong (to different degrees depending on the browser) It was only 200px out in the Y axis in Firefox but in IE7&8 its off the screen. I've tried googling for an answer but I can't seem to find a workable solution, mostly I've been coming up with absolute position scripts or 'just use jquery' answers. 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 Is this possible? I am writing a script that will display an alert box that reads "your play was saved" after a user clicks the submit button on a form. The only problem is that after clicking save, the page refreshes. Here is the code I tried to use Code: function savedMessage(){ document.getElementById("CmdFinish").addEventListener("click",function(e) { GM_setValue("Saved", 1); }, false); if (GM_getValue("saved", 0) == 1) { alert("Your play has been saved"); GM_setValue("saved", 0); // or GM_deleteValue("saved"); } } The button ID is "CmdFinish" and the value is "saved". Is there ANY way i can make the script run only on a page refresh? **Note** The script is for a specific page and not the whole site, so it wont run on every refresh on the site, only when it's needed on 1 page. I was given this bit of code: Code: <img src="current.jpg" name="refresh" width="306" height="408"> <script language="JavaScript" type="text/javascript"> <!-- image = "current.jpg" //name of the image function Reload() { tmp = new Date(); tmp = "?"+tmp.getTime() document.images["refresh"].src = image+tmp setTimeout("Reload()",1000) } Reload(); // --> </script> to refresh a webcam image. I want to know what it means--how often is it set to refresh? I don't know javascript so I can't tell. Is it set to refresh whenever the image is new? or what? I would like to move away from my meta-refresh page-in-an-iframe method of refreshing my webcam if I can. My cam uploads a new image every 5 seconds. I need code that would allow the new image to be seen. Will this code do it? I tried it and it doesn't seem to refresh that often. So what does it do, and can it be tweaked? Been trying to get this auto refreshed instead of clicking to refresh <center><iframe src="http://orange.citrus3.com:8338/played.html" width=800 height=400 frameborder=0 scrolling=no id="myiframe"></iframe></center><br> <center><b><BIG><body link="#FF0000"><a href="javascript:myiframe.document.location.reload()">Refresh Current Song</a></BIG></b></center> This script has been around a while (I know it's old) but it works in IE when you mouseover an image...you can make text scroll up or down. The problem is it goes pretty fast, even if you use the lowest speed (1). Is there a way to slow it down. Or a better script lying around anywhere? Code: function verScroll(dir, spd, loop) { loop = true; direction = "up"; speed = 10; scrolltimer = null; if (document.layers) { var page = eval(document.contentLayer); } else { if (document.getElementById) { var page= eval("document.getElementById('contentLayer').style"); } else { if (document.all) { var page = eval(document.all.contentLayer.style); } } } direction = dir; speed = parseInt(spd); var y_pos = parseInt(page.top); if (loop == true) { if (direction == "dn") { page.top = (y_pos - (speed)); } else { if (direction == "up" && y_pos < 10) { page.top = (y_pos + (speed)); } else { if (direction == "top") { page.top = 10; } } } scrolltimer = setTimeout("verScroll(direction,speed)", 1); } } function stopScroll() { loop = false; clearTimeout(scrolltimer); } EXAMPLE: <a href="#" onmouseover="verScroll('up',' 1 ','true')" onmouseout="stopScroll()" style="text-decoration: none"> <span class="1"> ◄◄ </span></a> I currently have this on my companies website and it's having a bit of trouble sometimes where it will only work after a refresh. Is it possible to do a refresh of this div and script as soon as the site loads, instead of using the auto refresh. I tried using auto refresh and it works but whatever time interval I put for the auto refresh is the time that the script pops up, so it kind of just makes it worst. Code: <script type="text/javascript"> $(document).ready(function() { $("#twitter").getTwitter({ userName: "lubellrosen", numTweets: 4, loaderText: "Loading Events...", slideIn: true, slideDuration: 750, showHeading: false, headingText: "Latest Tweets", showProfileLink: false, showTimestamp: false }); }); </script> Hi All Is is possible to 'Refresh' a script when the browser window is resized? I know how to execute a script using the (window).resize event but I effectively need to 'destroy' the initial instance and re-load it. This must be acheived without refreshing the browser If it helps I'm using the SmoothDivScroll plugin which has a known bug whereby widths aren't recalculated when the window is resized. The script stops working untill the browser is restored to it's initial width and unfortunately I don't have the expertise to fix that All help appreciated Cheers Craig |