JavaScript - How To Make Web Site Browser Independent
Hello
Am designig a web site i want that sote to be appear same in all browser is their any script which makes my site look same in all browsers Similar TutorialsHi all, can anyone recommend me nice tooltip script which is javascript library independent, meaning no help/code from any of libraries such as (jquery, prototype,scriptalicious, mootools,extjs etc.). Here is the one I particularly like but it uses protoype and that is not option for me now, because I'm just integrating something else into already existing huge script and I don't wanna mess up old functionality or bring some additional unnecessary overhead. Or even better if you can give me some guidelines / pointers , how to make one from scratch that would be acceptable for me also. The most important thing is that it points from above downwards, because I found like dozen of good ones but pointing from below. Here is an example what I mean when I say from pointing from above. Thank you Hi I am building a site for use on a local server and I want it so that when you launch the file it will it automatically remove the toolbars. If anyone can help It would be great. Thanks I'm having trouble duplicating my working voting function code. It only works with one copy, but once I copy and paste it into a second copy it seizes it to work no matter what I do even if I change the name, value, class or id names. If I press the vote up or vote down button it affects only one of the copies Here is an incomplete fiddle that need some troubleshooting: Edit fiddle - JSFiddle Help me figure out how to get an independent second copy of the following code: Javascript: Code: $(document).ready(function() { $('.vote').click(function() { $('img', this).attr('src', function(i, oldSrc) { return oldSrc == 'voteup.png' ? 'votedown.png' : 'voteup.png'; }); $('.voteswitch').toggle(400); return false; }); }); function showMessage(which) { if (which == 1) { document.getElementById("voteup").style.display = "block"; document.getElementById("votedown").style.display = "none"; document.getElementById("notrated").style.display = "none"; } else { document.getElementById("voteup").style.display = "none"; document.getElementById("votedown").style.display = "block"; document.getElementById("notrated").style.display = "none"; } } HTML: Code: <!-- Voting--> <div class="votesystem"> <input name="vote" class="voteup" type="radio" value="Yes" onclick = "showMessage(1)"/> <label class="voteup-label" for="voteup"></label> <!--Vote Number--> <div class="votenumber"> <div id="voteup" style="display:none">100<span class="percentagesign">%</span></div> <div id="notrated">Not Rated</div> <div id="votedown" style="display:none">0<span class="percentagesign">%</span></div> </div><!--End Votenumber--> <input name="vote" class="votedown" type="radio" value="No" onclick = "showMessage(2)"/> <label for="votedown"></label> <p class="votecounter">0 Votes</p> </div><!--End Voting--> CSS: Code: .votesystem { display:inline-block; list-style-type: none; padding-top:3px; border-left:#000 1px solid; border-bottom:#000 1px solid;width:85px; text-align:center; height:107px; float:right; position:relative; } input.voteup a { background-image: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); background-repeat: no-repeat; overflow: hidden; display: block; margin: 0 auto; width: 41px; height: 25px; } input.voteup[type="radio"]{ opacity: 0; right:33px; margin-top:7px; position:absolute; cursor:pointer; } input.voteup[type="radio"]+label{ background:: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); background-position: 0px -230px; padding-left:40px; padding-bottom:10px; } input.voteup[type="radio"]:checked+label{ background: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); background-position: 0px -230px; } input.voteup[type="radio"]:hover+label{ background: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); padding-left:40px; padding-bottom:10px; background-position: 0px -230px; } input.votedown[type="radio"]{ opacity: 0; right:33px; margin-top:-5px; position:absolute; cursor:pointer; } input.votedown[type="radio"]+label{ background: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); background-position: 0px -300px; padding-left:40px; padding-top:9px; } input.votedown[type="radio"]:checked+label{ background: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); background-position: 0px -330px; padding-left:40px; padding-top:9px; } input.votedown[type="radio"]:hover+label{ background: url('http://janosgyerik.github.io/jquery-upvote/lib/images/sprites-programmers.png?v=1'); padding-left:40px; padding-top:9px; background-position: 0px -330px; } .votenumber { color:#666; font-size:22px; margin:0; font-weight:bold; font-family:Arial, Helvetica, sans-serif; line-height:42px; padding-top:5px; padding-bottom:2px; } #notrated { font-size:15px; color:#999; } #voteup { margin-left:-2px;} #votedown { margin-left:-2px;} .percentagesign { font-size:15px; margin-top:-3px; position:absolute; } .contentarea { width:100%; height:100%; background-color:#CF3; display:block; } .votecounter { position:relative; top:8px; color:#000; font-family:Tahoma, Geneva, sans-serif; font-size:12px; } Hi There I am new to Javascript and this forum. I found and changed a browser for my website. It works great and I am happy with it the only problem I am having is I dont know how to link the buttons to pages that would oad into the same age as where the menus are in. Can anyone help me getting started - It would be highly appreciated. to c the menus - http://abc-magasin.com/BROWSER/browser.html the code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Serious Seeds</title> <!--NodeFire API Script Reference--> <script type="text/javascript" src="js/api.js"></script> <!--Pure CSS Core (menu widget)--> <!--[if lte IE 6]><style type="text/css">.nfPure .nfItem{width:0px;}</style><![endif]--> <!--[if lte IE 7]><style type="text/css">.nfMain,.nfMain .nfLink,.nfMain .nfSubS{zoom:1;}.nfPure .nfLink:hover{z-index:1101;}.nfPure .nfItem{display:inline !important;}</style><![endif]--> <link rel="stylesheet" href="css/menu_core.css" type="text/css"> <!--Apply Horizontal Subs Layout--> <link rel="stylesheet" href="css/layouts/menu_horizontalAndVerticalSubs.css" type="text/css"> <!--Style Skin (menu widget)--> <link rel="stylesheet" href="css/skins/menu_horizontalSub1.css" type="text/css"> <!--Custom Styles--> <style type="text/css"> /*~~~~~~~~~~~~~~ Custom Menu Classes ~~~~~~~~~~~~~~~~*/ .myTitle {color:#453f2e;font-family:arial;font-size:.9em;font-weight:normal;margin:20px 0px 5px 0px;} .myTitleTop {margin:5px 0px;} .style1 {color: #006600} </style> <!--Tweak a 1px margin difference for IE6 (overrides the skin styles)--> <!--[if lte IE 6]><style type="text/css">.nfMain .nfSubC {margin:1px 0px 0px 6px;}.nfMain .nfSubS .nfSubC {margin:1px 0px 0px -1px;}</style><![endif]--> </head><body style="margin:105px 0px 0px 3px;background:#ffffff url('images/gallery/menu/horizontalSub1/bg.png') repeat-x"> <!--LATEST NEWS--> <ul id="myMenu" class="nfMain nfPure"> <li class="nfItem"> <div class="nfLink">Latest News</div> <dl id='mySub1' class="nfSubC nfSubS nfPure"> <dd class="nfItem"><div class="nfLink">Keep up to Date</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">New Strain - Serious 6</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">2</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">3</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">4</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">5</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">6</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Feminized Seeds</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Now feminized seeds available</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">2</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">3</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">4</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">5</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">6</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Serious moves to 11 seeds</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a href="date.html" target="_browser" class="nfLink">Why we move to 11 seeds?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">2</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">3</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">4</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">5</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">6</a> </dd> </dl> </dl> </li> <!--------------------ORDERFORM---------------------> <li class="nfItem"> <div class="nfLink">Orderform</div> <dl id='mySub8' class="nfSubC nfSubS nfPure"> <dd class="nfItem"><div class="nfLink">Order Seeds</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Before you order - read this</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">How to order seeds</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Terms and Conditions</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Shipping</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Availability of Seeds</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Regular Seeds</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Feminized Seeds</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Orderform</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Before you order ...</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Read this statement first</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Shipping</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Get the Orderform</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Glossary</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Glossary 1</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Glossary 2</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Glossary 3</a> </dd> </dl> </dl> </li> <!--------------------FORUM---------------------> <li class="nfItem"> <div class="nfLink">Forum</div> <dl id='mySub9' class="nfSubC nfSubS nfPure"> <dd class="nfItem"><div class="nfLink">Sign up</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Before you sign up - read this</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">What to find in the forum</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Upload your own pictures</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Chatbox</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Go to the Serious Seeds forum</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Link to Forum</a></dd> </dd> </dl> <dd class="nfItem"><div class="nfLink">Glossary</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Glossary 1</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Glossary 2</a> </dd> </dl> </dl> </li> <!--------------------FAQ'S---------------------> <li class="nfItem"> <div class="nfLink">Faq</div> <dl id='mySub11' class="nfSubC nfSubS nfPure"> <dd class="nfItem"><div class="nfLink">AK-47</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">AK question 2</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Bubble Gum</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">BQ question 2</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Chronic</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">CH question 2</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Kali Mist</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">KM question 2</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Serious 6</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">S6 question 2</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">White Russian</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">WR question 2</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">General Questions</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">How many seeds per square meter?</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 2</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 3</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 4</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 5</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 6</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 7</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 8</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 9</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 10</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">GQ question 11</a> </dd> </dl> <dd class="nfItem"><div class="nfLink">Glossary</div> <dl class="nfSubC nfSubS"> <!--<dt class="myTitle myTitleTop">Round 'n Round</dt>--> <dd class="nfItem"><a class="nfLink" href="javascript:void(0)">Glossary 1</a></dd> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Glossary 2</a> <dd class="nfItem"><a class="nfLink" href="javascript:setpath()">Glossary </a> </dd> </dl> <p> </p> </dl> <p> </p> <dl class="nfSubC nfSubS nfPure"> <dd class="nfItem"> <p> </p> </dl> </li></ul> <p> </p> <p> this is where I would like my pages to open when clicked on the pulldownmenus </div></p> <script type="text/javascript"> //Create the main menu object var myMenuConfig = {showTimerMS:500, hideTimerMS:500, menuTrigger:['none','mouseover'], documentTrigger:'none'}; var myMenu = new NF.widget.menu("myMenu", myMenuConfig); //Create the sub level 1+ menu objects var mySub1 = new NF.widget.menu("mySub1", {showTimerMS:150, hideTimerMS:150}); var mySub2 = new NF.widget.menu("mySub2", {showTimerMS:150, hideTimerMS:150}); var mySub3 = new NF.widget.menu("mySub3", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub4", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub5", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub6", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub7", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub8", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub9", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub10", {showTimerMS:150, hideTimerMS:150}); var mySub4 = new NF.widget.menu("mySub11", {showTimerMS:150, hideTimerMS:150}); //HTML for main item down arrows var html = "<img class='arrowDown' src='images/gallery/menu/horizontalSub1/downArrow1.gif' width=11 height=11 style='position:absolute;border-width:0px;left:11px;top:2px;visibility:hidden;'/>"; //Create a new replicator with the html string. Config properties specify where to target the replicated clones var downArrowReplicator = new NF.replicator("content", {master:html, widgetClass:"nfParent", targetClass:"nfLink", widgetLevel:0, addWhe "first-child"}) myMenu.addReplicator(downArrowReplicator); //Show Down Arrow Animation var clip = new NF.anim.clip({opacity:{start:0,end:1}},{frames:20,hook:"NFplayOnLinkActiveShow",targetClass:"arrowDo wn",startStyles:{visibility:'visible'}}); myReplicator = new NF.replicator("transition",{master:clip,widgetClass:"nfItem",targetClass:"nfLink",widgetLevel:0}); myMenu.addReplicator(myReplicator); //Hide Down Arrow Animation var clip = new NF.anim.clip({opacity:{start:1,end:0}},{frames:20,hook:"NFplayOnLinkActiveHide",targetClass:"arrowDo wn",endStyles:{visibility:'hidden'}}); myReplicator = new NF.replicator("transition",{master:clip,widgetClass:"nfItem",targetClass:"nfLink",widgetLevel:0}); myMenu.addReplicator(myReplicator); //Activate the menu objects NF.widget.menuManager.activateMenus(); //Set an initial active path NF.widget.menuManager.setActivePath(mySub1.root); function handle_radio(e,type) { if (type=="click") { //Each array item corresponds with a menu level starting at the main myMenuConfig.itemTrigger = ['click','mouseover'] } else myMenuConfig.itemTrigger = null; } </script> <body> </body> </html> http://www.silverbackmusic.net/home Please skip the intro. I'm talking about the navigation of this site. The way there is one huge background and clicking on each page moves the background to a certain part. Is there a way I can pull this off using some form of javascript? 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 need a script that will redirect to a specific page is the browser is safari version 4. if the browser is NOT safari 4 I want the browser to stay on the current page.
Greetings, I am currently using the websites tutorial about browser detection using the navigator. http://www.javascriptkit.com/javatutors/navigator.shtml I am however finding myself unable to detect a pattern in order to learn from. My aim is to use Browser detection to have a CSS file for each browser type, such as Firefox, IE, Opera, Safari and then an overall CSS file if none of the above, to fix numerous flaws. For IE and Firefox using the site's code is all well and good and while I haven't tested it yet I'm wondering how to set up the coding so that it can detect a safari browser. There are lots of slashes and d's and brackets and I do find myself unable to understand their purpose. So if someone can explain how I could do it for Safari I would be very appreciative. Hello, I have a question what is the best way to identify a browser, browser version and OS in javascript. I have try a few scripts but they all fail. This will help me out formating the code for diferent browsers. Thanks need to make "left click" act as "middle click" -------------------------------------------------------------------------------- I need to make "left click" act as "middle click" for a web site ....thank you in advance for any and all help... [CODE] <script language="javascript"> function Click(4) { if (event.button==0; 1; ) } document.onmousedown </script>> I'l not good in Javascript and I can't find anything about what I want.. . On a sports website there is a table with our ranking and results. On this site the content is changed weekly, but it stays in the same tables.. . Is it possible to make a javascript to get those tables and put them on my own website so the content will change on my site when the content is changed on the sports site? Please help me, it would save me lot of time.. . THx Hey, new guy here, not sure if this should be under XML, but this was my best guess. Am working with javascript, need to pull the text content from a bunch of places on the page, then I build xml with them, and now i want to have a button that will take user to a page in the browser where all they see is the raw xml tree. Help? Hi, i wanted to know whats wrong with this coding as its making the browser crash, firefox 5 $(document).ready(function() { /* open rel=external in new window */ $('a[rel=external]').attr('target', '_blank'); /*Scrolling background clouds */ var offset = 600; var offseta = 1450; function scrollbackground() { // decrease the offset by 1, or if its less than 1 increase it by // the background height minus 1 offset = offset + 1; offseta = offseta + 1; // apply the background position if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { $('#cloud2').css("background-position", offseta + "px top"); } else { $('#cloud').css("background-position", offset + "px top"); $('#cloud2').css("background-position", offseta + "px top"); } // call self to continue animation setTimeout(function() { scrollbackground(); }, 100 ); } // Start the animation scrollbackground(); }); //end Hi, I wrote some javascript for a slideshow. The main webpage contains: Code: <FORM NAME="myform"> <IMG SRC="firstimage.jpg" NAME="mypic"><br> <INPUT TYPE="text" SIZE="180" NAME="mycaption" VALUE="First Caption"> <INPUT TYPE="button" VALUE="Prev" NAME="prevbutton" DISABLED=true ONCLICK="slideshowBack()"> <INPUT TYPE="button" VALUE="Next" NAME="nextbutton" ONCLICK="slideshowUp()"> </FORM> which assigns the image and caption for the first picture, and sets the Prev and Next buttons to disabled and not disabled respectively. So you start with the first image and caption, and an enabled "Next" button. I have global javascript variables: num (init to 1), max (init to 7), img1..7 (new Image ()), img1..7.src (filenames for the images), text1..7 (captions for the images), map1..7 (maps for the images). The function for moving to the next slide is: Code: function slideshowUp() { num=num+1 if (num==max+1) {num=1} document.mypic.src=eval("img"+num+".src") document.getElementById("mypic").useMap=eval("map"+num) document.myform.mycaption.value=eval("text"+num) document.getElementById("prevbutton").disabled=(num==1) document.getElementById("nextbutton").disabled=(num==max) } I developed this in HMTLPad (10.2) and it works perfectly in that program's preview mode. But it won't work in the main browsers! In IE 9 (9.0.33), when you click the Next button, nothing at all happens. Image and caption stay the same, Next stays enabled, Prev stays disabled. Maps don't work. Chrome (38.0.2125.122 m) and Firefox (27.0) behave like each other. The images change, but not the captions or the Prev/Next buttons. Maps don't work. Is this to be expected? If so, how do I work around it? I am attempting to make an page on my website where visitors can set my website as their homepage. I am trying to make my website read which browser my visitors are using and then redirects them to the page for the right browser where I can tell them how they can set my website as their homepage. Basically I need exactly the same thing as THIS. Could you explain to me in plain English how I can realize this. This is what I know have: Code: <table width="759" border="0" align="center" cellpadding="0" cellspacing="0" > <tr align="center"> <td width="378" height="28" align="right">Selecteer jouw browser </td> <td width="16"></td> <td width="365" align="left"><form id="browserSelection" name="browserSelection" action="customizeBrowser" method="GET"><select name="browser" size="1" id="browser" onchange="document.browserSelection.submit();"><option value="ff" selected>Firefox</option><option value="ie">Internet Explorer</option><option value="chrome">Chrome</option><option value="opera">Opera</option><option value="safari">Safari</option></select></form></td> </tr> </table> ________________________________________ Please tell me if I make any English mistakes in my posts. I am trying to write as perfectly possible. hey all is there a code where I can detect if the browser is IE6 or IE7 and send them to another webpage? my current design is not compatible with IE6 or 7 and i want to make a new page that's compatible. thanks! Hello, I couldn't find another thread that had this problem but it seems like it would be fairly simple. I am also just now starting to learn JavaScript. But when I enter this code into Notepad++ Code: <HTML> <HEAD> </HEAD> <BODY> <SCRIPT type = "text/javascript"> document.write("Hello World"); </SCRIPT> </BODY> </HTML> Instead of printing out "Hello World" as it should, it simply shows me the code I wrote line for line. I have tried opening in both Chrome and IE and since all other webpages work fine I assume that both browsers have javascript enabled. Thanks in advance Hi, On www.pizzalita.com, I added a div layer that would ask people for an email address and if you don't like to, you camn click the cross to close that layer. This works just fine in Google Chrome but I today realized that it doesn't work for other browsers, not in IE nor in Firefox. Does anyone have any hints, suggestions and tips how to resolve this to get it working properly in all browsers? Firefox says it can't find the function closediv() - but why not, it is there, I can look at the source and I see it.... any clues would be awesome! Thank you very much, help is appreciated! Ron I have code that I've been using for awhile now that will automatically log users off my site after a period of time. It works great using a 32 bit browser but not at all with a 64 bit browser. For the life of me I can't figure this out. <script type='text/javascript'> var secondsRemaining = 30; var mhcTimer; function countDown() { secondsRemaining -= 1; if (secondsRemaining <= 0) { secondsRemaining = 0; window.location='login.aspx'; } } function startAutoLogoff() { if (mhcTimer) { return false; } else { mhcTimer = setInterval('countDown();', 1000); } } startAutoLogoff(); </script> In the past I write the jave script to popup windows in the browser for tell our visitor about news & event but now most of browser will block popup by default. Someone can show me an example about the professional popup with out the block.Thank you
|