JavaScript - Javascript Activate Tab Code
I have a website that has some javascript on it. I need to change one of the js files so that it doesn't reload the main "slideshow" (HTML5) files every time there is a click to a new page. here is the code that is causing...
[CODE] $(document).ready(function() { //When page loads... $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { $("ul.tabs li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); }); [CODE] I can't get rid of any of the lines or else it messes with my code, but when it "activates" the first tab is where I want that "first tab" to stay on what the user had clicked before, I don't want reactivation basically....please help! Similar TutorialsI am using a web tracking tool called REinvigorate, which is great but doesn't give you the ability to exclude specific referring domains from the stats. However, their support guy told me that I can accomplish this by referencing the referring domain in a small script that only calls the tracking code when the referring site is not "This one we don't want in our stats". I only know C# and SQL, though, so I'm not entirely sure how to do this. Is this right? spreecommerce.com is the domain we want to exclude... <script type="text/javascript"> if (document.referrer.search("/spreecommerce/") != -1) { document.getElementById('iFrameId').src = '<trackingcode>'; } </script> Thanks! Austin Is there a line of code I can add to my slideshow code to have the slideshow activated by mouseOver and show the main picture on mouseOut, or do I have to redo the code? I've been searching online for a while and can't find anything that works. Any help would be appreciated! Code: <script language="JavaScript1.1"> <!-- /* JavaScript Image slideshow: By JavaScript Kit (www.javascriptkit.com) Over 200+ free JavaScript here! */ var slideimages=new Array() function slideshowimages(){ for (i=0;i<slideshowimages.arguments.length;i++){ slideimages[i]=new Image() slideimages[i].src=slideshowimages.arguments[i] } } //--> </script> <img src="https://lh3.googleusercontent.com/-_ZBn3vpI1aM/TeT4Ty9Dh8I/AAAAAAAABQ8/OWXNUQfXn5U/butterfly.png" name="slide" border=0 width=50 height=47> <script> <!-- //configure the paths of the images, plus corresponding target links slideshowimages("https://lh6.googleusercontent.com/-bPZjekuMNX8/TeT4TyZ2z7I/AAAAAAAABRA/swrVvRqHTpM/butterfly1.png","https://lh6.googleusercontent.com/-fM-kMmy3STQ/TeT4T_aq5hI/AAAAAAAABRE/oq4rGMy8-Qs/butterfly2.png","https://lh3.googleusercontent.com/-jR41bich1pw/TeT4UFyGefI/AAAAAAAABRI/2V8B6bx8P0o/butterfly5.png", "https://lh3.googleusercontent.com/-_ZBn3vpI1aM/TeT4Ty9Dh8I/AAAAAAAABQ8/OWXNUQfXn5U/butterfly.png") //configure the speed of the slideshow, in miliseconds var slideshowspeed=200 var whichlink=0 var whichimage=0 function slideit(){ if (!document.images) return document.images.slide.src=slideimages[whichimage].src whichlink=whichimage if (whichimage<slideimages.length-1) whichimage++ setTimeout("slideit()",slideshowspeed) } slideit() //--> </script> <p align="center"><font face="arial" size="-2">This free script provided by</font><br> <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript Kit</a></font></p> JavaScript Code: window.addEvent('domready',function(){ //SAMPLE 8 var handles8_more = $$('#handles8_more span'); var nS8 = new noobSlide({ box: $('box8'), interval: 5000, autoPlay: true, items: $$('#box8 h3'), size: 900, handles: $$('#handles8 span'), handle_event: 'mouseenter', addButtons: { previous: $('prev8'), play: $('play8'), stop: $('stop8'), playback: $('playback8'), next: $('next8') }, onWalk: function(currentItem,currentHandle){ //style for handles $$(this.handles,handles8_more).removeClass('active'); $$(currentHandle,handles8_more[this.currentIndex]).addClass('active'); //text for "previous" and "next" default buttons $('prev8').set('html','<< '+this.items[this.previousIndex].innerHTML); $('next8').set('html',this.items[this.nextIndex].innerHTML+' >>'); } }); //walk to item 0 witouth fx nS8.walk(0,false,true); }); html Code: <div class="slider sample8"> <p class="buttons" id="handles8"> <span>Item 1</span><span>Item 2</span><span>Item 3</span><span>Item 4</span><span>Item 5</span> </p> <div class="mask1"> <div id="box8"> <div onMouseOver="nS8.Stop();" onMouseOut="nS8.Play();"> </div> </div> </div> <p class="buttons"> <span id="prev8"><< Previous</span> | <span id="next8">Next >></span> </p> <p class="buttons"> <span id="playback8">< Playback</span> <span id="stop8">Stop</span> <span id="play8">Play ></span> </p> </div> All I need to do is when they hover ocer the div statement stop the program from looping. and then when they stop hovering over it let it start looping again. Hi Guys I am trying to modify the functionality of my page. I want to be able to activate this piece of code using another javascript function. This is the code I want to activate: Code: <script type="text/javascript"><!-- $('#button-cart').bind('click', function() { $.ajax({ url: 'index.php?route=checkout/cart/update', type: 'post', data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea, .date_data input[type=\'text\']'), dataType: 'json', success: function(json) { $('.success, .warning, .attention, information, .error').remove(); if (json['error']) { if (json['error']['warning']) { $('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'); $('.warning').fadeIn('slow'); } for (i in json['error']) { $('#option-' + i).after('<span class="error">' + json['error'][i] + '</span>'); } } if (json['success']) { $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>'); $('.success').fadeIn('slow'); $('#cart_total').html(json['total']); $('html, body').animate({ scrollTop: 0 }, 'slow'); } } }); }); //--></script> And this is how I want the format of the function to be: function testsession() { if there is a session called 'hiredate' { activate the script above } else { var el = document.getElementById("product_data"); } } I just dont know how to write this in javascript Could you help me if possible please Hello! My first (but surely not last) post on this forum. I made a drop box menu and I want to activate specific javascript functions when they are selected. I think this should be fairly easy to solve. I am very new at HTML and Javascript btw. This is what I tried: if (document.getElementById("selectense").value="present"){ document.getElementById("present").style.visibility="visible"; } <span class="tensebox"> <select id="selectense"> <option onclick="showPresent()">Present</option> <option onclick="showPC()">Present</option> </select></span> (and I have some text with the ID "present) I made a mouseover event of a caption on a picture, when I hover the opacity of the background color of the hover and the text goes down. What I want is that when I hover over the image which the caption is floating on, the onmouseover event gets activite. For an imaginary example: Code: function unhighlight(x) { x.style.backgroundColor="transparent" } Function ActivationFuction() { activate.function="unhighlight" } thanks I would like to take this timeout: Code: setTimeout("hidediv('layer')", 2000); And activate only when the mouse leaves the DIV and de-activate when the mouse comes back in. Is this possible and how? What are those events? hello I have a list of checkbox called de[] i use [] for create array in php so i have a button called "delete" so i want to activate the button if almost one of checkbox has been checked other way the input button will be disable. sorry for my english jejejeje. Regards Hi guys I am using a customized version of this free css dropdown menu script. It is just pure css, no jquery. I wanted to add some delay to the open and close on mouseover, here is what I added: Code: <script type="text/javascript"> $(document).ready(function () { $('ul.dropdown li').hover( function () { //show its submenu $('ul', this).slideDown(150); }, function () { //hide its submenu $('ul', this).slideUp(250); } ); }); </script> When I first mouse over, this does nothing, but if I mouse over the same drop down li a second time, it works. Check it out here. Any ideas on how I can fix this? go he http://qodeplay.com/javascript help me accomplish this and send this data to a mysql column! note: the field will not grey out in ie. ok so here is my situation i have 4 hidden fields in a form called "searchform" Code: <input type="hidden" name="forumchoice[]" value="1" checked /> <input type="hidden" name="forumchoice[]" value="2" checked /> <input type="hidden" name="forumchoice[]" value="3" checked /> <input type="hidden" name="forumchoice[]" value="4" checked /> Now here's what i want to do: i have two checkbox Code: <input onclick="??????????" type="checkbox" name="checkbox1" id="checkbox1"/> <input onclick="??????????" type="checkbox" name="checkbox2" id="checkbox2"/> - when checkbox1 is checked, i want to activate the hidden inputs 1 & 2. if it is unchecked, then desactivate hidden inputs 1&2 - when checkbox2 is checked, i want to activate the hidden inputs 3 & 4. if it is unchecked, then desactivate hidden inputs 3&4 could someone help me with the "onclick" code i would need to do this ?? thanks a lot!! hi, on my site: http://helix3d.previewsite.co.uk/marketing.html the images slide onto the next when the numbers are clicked, I would like to have this functionality on the actual image... need a bit of help here?! Code: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Helix</title> <link type="text/css" rel="stylesheet" href="css/reset.css"> <link rel="stylesheet" type="text/css" href="css/style.css" title="default" /><!--[if lte IE 7]> <style type="text/css"> html .jqueryslidemenu{height: 1%;} /*Holly Hack for IE7 and below*/ </style> <![endif]--> <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="js/jquery.cycle.all.min.js"></script> <script type="text/javascript"> $(function() { $('#slideshow1').after('<div id="nav1" class="nav">').cycle({ fx: 'fade', speed: 'fast', timeout: 0, pager: '#nav1', befo onBefore }); $('#slideshow2').after('<div id="nav2" class="nav">').cycle({ fx: 'fade', speed: 'fast', timeout: 0, pager: '#nav2', befo onBefore }); $('#slideshow3').after('<div id="nav3" class="nav">').cycle({ fx: 'fade', speed: 'fast', timeout: 0, pager: '#nav3', befo onBefore }); $('#slideshow4').after('<div id="nav4" class="nav">').cycle({ fx: 'fade', speed: 'fast', timeout: 0, pager: '#nav4', befo onBefore }); $('#slideshow5').after('<div id="nav5" class="nav">').cycle({ fx: 'fade', speed: 'fast', timeout: 0, pager: '#nav5', befo onBefore }); function onBefore() { $('#title').html(this.alt); } }); </script> </head> <body> <div id="top"> <div id="topwrapper"> <a href="index.html"><div id="logo"> </div></a> <ul id="rightnav"> <li><a href="index.html" title="Home">Home</a></li> <li><a href="news.html" title="News">News</a></li> <li><a href="services.html" title="Services">Services</a></li> <li><a href="archive.html" title="Archives">Archive</a></li> <li><a href="finishes.html" title="Finishes">Finishes</a></li> <li><a href="showreel.html" title="Showreel">Showreel</a></li> <li><a href="contact.html" title="Contact">Contact</a></li> </ul> <nav> <ul> <li><a href="events.html" title="HELIX EVENTS">HELIX EVENTS</a></li> <li><a href="marketing.html" title="HELIX EXPERIENTIAL MARKETING" class="menuselected">HELIX EXPERIENTIAL MARKETING</a></li> <li><a href="film.html" title="HELIX FILM & TV SET CONSTRUCTION">HELIX FILM & TV SET CONSTRUCTION</a></li> <li><a href="exhibitions.html" title="HELIX EXHIBITIONS">HELIX EXHIBITIONS</a></li> <li><a href="interiors.html" title="HELIX COMMERCIAL INTERIORS">HELIX COMMERCIAL INTERIORS</a></li> </ul> </nav> <div class="line"> </div> </div> </div> <div id="content"> <section id="slider"> <div id="viewport"> <div id="container"> <div id="section-1" class="section"> <img src="images/hero_experiential.jpg"> </div> </div> </div> </section> <div class="line"> </div> <div id="left"> <h1>HELIX MARKETING</h1> <p>We help brands and agencies create experiences that excite, surprise and delight. Our attention to detail and fast-paced production bring your experiential marketing to life and ensure memorable, positive brand connections.</p> </div> <div id="right"> <img src="images/quote-marketing.gif" alt="Marketing quote" /> <ul> <li class="youtube"><a href="#"><img src="images/yt.png" alt="youtube" /></a></li> <li class="twitter"><a href="#"><img src="images/twit.png" alt="Twitter" /></a></li> <li class="facebook"><a href="#"><img src="images/fb.png" alt="Facebook" /></a></li> </ul> </div> <div class="clear"> </div> <div class="dashedlinetop"> </div> <div id="box1"> <h1>01</h1> <h2>V Hand</h2> <p>We were contracted by Speed Communications PR to turn ideas from the creative team at The Game Changer into reality. The concept was a giant hand over 30 ft tall making the V for Virgin sign, designed to look as if it had burst up through the ground.</p> <ul> <li><strong>Key people:</strong></li> <li>Client: Virgin Business Media.<br> Agency : Speed Communications.<br> Creative : The Game Changer<br> Location : Canary Wharf</li> </ul> <div id="casestudy1"><a href="case-study-virgin.html">CASE STUDY</a></div> <div id="slideshow1" class="pics"> <img src="images/marketing/virgin1.jpg" alt="1"/> <img src="images/marketing/virgin2.jpg" alt="2"/> <img src="images/marketing/virgin3.jpg" alt="3"/> <img src="images/marketing/virgin4.jpg" alt="4"/> <img src="images/marketing/virgin5.jpg" alt="5"/> </div> </div> <div class="dashedlinebottom"> </div> <div class="dashedlinetop"> </div> <div id="box2"> <h1>02</h1> <h2>Cat Walk</h2> <p>We were commissioned by Mischief PR to design, manufacture and project manage the installation of the world's first car mounted fashion catwalk. We scoured London for priceless shoot locations normally off limits and organised logistics to enable a super fast, film shoot set up.</p> <ul> <li><strong>Key people:</strong></li> <li>Client : Vauxhall.<br> Agency : Mischief PR.<br> Creative : Dan Glover.<br> Location : St Paul's Cathedral</li> </ul> <div id="slideshow2" class="pics"> <img src="images/marketing/carwalk1.jpg" alt="1"/> <img src="images/marketing/carwalk2.jpg" alt="2"/> <img src="images/marketing/carwalk3.jpg" alt="3"/> <img src="images/marketing/carwalk4.jpg" alt="4"/> <img src="images/marketing/carwalk5.jpg" alt="5"/> </div> </div> <div class="dashedlinebottom"> </div> <div class="dashedlinetop"> </div> <div id="box3"> <h1>03</h1> <h2>Tower of Terror</h2> <p>As the centre piece of the European launch of the Disney's new Tower Of Terror ride in Paris, Cow PR commissioned us to design and build a full seized replica model of a lift car from the ride. The twist was that the lift had to look as if it had crash landed!</p> <ul> <li><strong>Key people:</strong></li> <li>Client : Disney<br> Agency : Cow PR<br> Creative : Claire Myddleton<br> Location : Leicester Square</li> </ul> <div id="slideshow3" class="pics"> <img src="images/marketing/tot1.jpg" alt="1"/> <img src="images/marketing/tot2.jpg" alt="2"/> <img src="images/marketing/tot3.jpg" alt="3"/> <img src="images/marketing/tot4.jpg" alt="4"/> <img src="images/marketing/tot5.jpg" alt="5"/> </div> </div> <div class="dashedlinebottom"> </div> <div class="dashedlinetop"> </div> <div id="box4"> <h1>04</h1> <h2>Ice Age 3</h2> <p>The set for this experiential brief; for 20th Century Century Fox's Ice 3 movie launch, was designed in house by Brian Dowling. The experience included an chilled Ice Cave and a jungle equipped with rock faces, real plants, a bridge, a lake and heated humidified air. </p> <ul> <li><strong>Key people:</strong></li> <li>Client.: 20th Century Fox.<br> Agency : Designwerk<br> Creative : Scott and Ed<br> Location : CWOA</li> </ul> <div id="slideshow4" class="pics"> <img src="images/marketing/ice1.jpg" alt="1"/> <img src="images/marketing/ice2.jpg" alt="2"/> <img src="images/marketing/ice3.jpg" alt="3"/> <img src="images/marketing/ice4.jpg" alt="4"/> <img src="images/marketing/ice5.jpg" alt="5"/> </div> </div> <div class="dashedlinebottom"> </div> <div class="dashedlinetop"> </div> <div id="box5"> <h1>05</h1> <h2>Hanging gardens of paddington</h2> <p>When Mischief PR wanted to create "The Hanging Gardens of Paddington" for the launch of boutique Hotel Indigo there was only one company on the call sheet. We devised a plan to cantilever the giant basket 40ft above the street, the story went global, the launch was a huge success.</p> <ul> <li><strong>Key people:</strong></li> <li>Client : International Hotel Group<br> Agency : Mischief PR<br> Creative : Dan Glover<br> Location : Paddington</li> </ul> <div id="slideshow5" class="pics"> <img src="images/marketing/basket1.jpg" alt="1"/> <img src="images/marketing/basket2.jpg" alt="2"/> <img src="images/marketing/basket3.jpg" alt="3"/> <img src="images/marketing/basket4.jpg" alt="4"/> <img src="images/marketing/basket5.jpg" alt="5"/> </div> </div> <div class="dashedlinebottom"> </div> <footer> <ul> <li><a href="index.html" title="Home">Home</a></li> <li><a href="events.html" title="Events Design">Events Design</a></li> <li><a href="marketing.html" title="Marketing Design">Marketing Design</a></li> <li><a href="film.html" title="Film & Set Design">Film & Set Design</a></li> <li><a href="exhibitions.html" title="Exhibition Design">Exhibition Design</a></li> <li><a href="interiors.html" title="Commercial Interior Design">Commercial Interior Design</a></li> <li><a href="#" title="Sitemap">Sitemap</a></li> <li><a href="contact.html" title="Contact Helix Ltd">Contact Helix Ltd</a></li> <li><a href="news.html" title="Latest Helix News">Latest Helix News</a></li> <li><a href="careers.html" title="Careers">Careers</a></li> </ul> <!--<div class="copyright">©2011 Helix </div> --> </footer> </div> <!-- end content --> </body> </html> hi everyone, firstly to call myself a noob would be inflating my ego. I have done one project in javascript so far and have had no schooling on the topic, however I have learned quite a lot in the last few months from this thing called the 'internet'. So far I managed to make an html image map that has various tooltips which will appear onmouseover, and the tooltip disappears onmouseout. Each point of coords that i have defined has a hyperlink to a different page on the internet. It works just like i wanted it to and i couldn't be happier, that is, when i'm using a mouse... When i am using a touchscreen device it is a different story. specifically i'm trying to port my html page to android as i figured it would be easy with the android sdk and webview (it was, but read on). What i found when i used the 'app' on my phone was that onmouseover works when you touch the screen, however it also registers as a click, so pop goes the tooltip, and i'm whisked away to my webpage. not the desired result. Ideally I would like to hold down the screen for 3 seconds and then the hyperlink would activate, but i decided that just getting the thing functional would suffice for the time beaing so i tried to include some 'ondblclick' that would trigger a document.location. This worked fine on a web browser again, but had no result on the touchscreen. I decided to abandon this half step because I have read that ondblclick doesn't work in an image map and it isn't my intended result anyway. I have found a lot of javascript and jquery samples that emulate the onHold event that i'm trying to achieve, both on this forum and all over the internet, however these samples are overly complex and are focused on looping an action, such as incrementally increasing a value or zooming or whatever. I just want to redirect the user to another page if they trigger 'onmousedown' for 3 seconds. anybody want to trade some help for a thankyou? Hi, On a registration form I have 4 fields that are all dropdown select fields. NAME, CLASS-1, CLASS-2, CODE 1) I would like to activate the CLASS-1, CLASS-2, CODE fields only if the NAME IS Selected from the dropdown. 2) Also would like to make the CLASS-1, CLASS-2 as required fields if the NAME is selected from the dropdown. How can I achieve this? Can I use some kind of a server event to activate / deactivate the fields on the form? Please advice Thanks Vinny Hi guys my friend has created a game where there are four boxes each numbered from one to four. When you click on these boxes you either get a tick or a cross. In every turn 3 boxes will have ticks and one will have a cross and the aim is to get as many ticks as possible (each tick gets you a point and when you come across a cross your points are all deleted). Anyway i was wondering if theres a way to guess which box will have a cross beforehand. He claims its random but i wanted to make sure. heres the javascript: var spath; var failbox; var score; var pushnumber; var clickedEl; var clickedElT; var waitEvent = 1; function losegameget() { waitEvent = 1; $(".games3of4 > .box > div").each(function (boxli) { jQuery(this).removeClass("check"); jQuery(this).removeClass("check2"); jQuery(this).removeClass("heart"); jQuery(this).removeClass("heart2") }); jQuery(".savegame").css("visibility", "hidden"); $(".asama").find("span").html("0"); jQuery(clickedEl).removeClass("heart"); jQuery(clickedEl).removeClass("heart2"); $(".losebox").css("display", "block"); $(".box").css("display", "none"); jQuery.get("/game1of3"); jQuery.get("/game1of3?score=1", function (json) { var jsonall; eval("jsonall = " + json + ";"); jQuery("#scoreliste").html(""); for (var i = 0; i < jsonall.length; i++) { jQuery("#scoreliste").append(jQuery('<li><div class="order">' + (i + 1) + "</div> " + jsonall[i]["username"] + " <span>(" + jsonall[i]["score"] + ")</span></li>")) } }); } function gameget() { var dd = $(".asama").find("span").text(); if (dd == "0") { $(".asama").find("span").text(0); } score = eval($(".asama").find("span").text()); $(".asama").find("span").empty().html(score + 1); $(".games3of4 > .box > div").each(function (boxli) { jQuery(this).removeClass("check"); jQuery(this).removeClass("check2"); }); waitEvent = 1; } function wgame() { waitEvent = 0; $(".games3of4 > .box > div").each(function (a) { jQuery(this).removeClass("check"); jQuery(this).removeClass("check2"); }); if (parseInt(jQuery(clickedEl).attr("rel")) == 1 || parseInt(jQuery(clickedEl).attr("rel")) == 2) { jQuery(clickedEl).addClass("check") } if (parseInt(jQuery(clickedEl).attr("rel")) == 3 || parseInt(jQuery(clickedEl).attr("rel")) == 4) { jQuery(clickedEl).addClass("check2") } setTimeout("gameget();", 200); } function losegame() { waitEvent = 0; $(".games3of4 > .box > div").each(function (a) { jQuery(this).removeClass("check"); jQuery(this).removeClass("check2"); jQuery(this).removeClass("heart"); jQuery(this).removeClass("heart2"); }); if (parseInt(jQuery(clickedEl).attr("rel")) == 1 || parseInt(jQuery(clickedEl).attr("rel")) == 2) { jQuery(clickedEl).addClass("heart"); } if (parseInt(jQuery(clickedEl).attr("rel")) == 3 || parseInt(jQuery(clickedEl).attr("rel")) == 4) { jQuery(clickedEl).addClass("heart2"); } setTimeout("losegameget();", 400); } function ifagain() { jQuery(".box").hide(); jQuery(".savegame").hide(); jQuery(".asama").hide(); jQuery("#againcall").show(); jQuery(".yes").click(function () { jQuery.get("/game1of3?start=1", function () { jQuery(".box").show(); jQuery("#againcall").hide(); jQuery(".savegame").css("visibility", "visible"); jQuery(".asama").show(); }) }) } function playSound(a) {} jQuery.jQueryRandom = 0; jQuery.extend(jQuery.expr[":"], { random: function (c, d, b, e) { if (d == 0) { jQuery.jQueryRandom = Math.floor(Math.random() * e.length) } return d == jQuery.jQueryRandom; } }); function countGet() { jQuery.get("/game1of3?count=1", function (a) { jQuery("#defa").html(a + " Defa Oynandı<br />"); }) } $(document).ready(function () { setInterval("countGet();", 20000); jQuery(".savegame").click(function () { if (confirm("Puanınızı kaydetmek istediğinizden emin misiniz ?")) { jQuery.get("/game1of3?save=1", function () { jQuery(".box").hide(); jQuery("#saved").show(); jQuery(".boxaga").show(); jQuery(".savegame").css("visibility", "hidden"); $(".highpoint").find("b").html($(".asama").find("span").text()); $(".asama").find("span").html("0"); }) } }); z = 0; $(".games3of4 > .box > div").each(function (boxli) { $(this).click(function () { if (waitEvent) { clickedEl = this; clickedElT = jQuery(this).attr("rel"); jQuery.get("/game1of3?res=" + jQuery(this).attr("rel"), function (data) { if (data == 'umustbelogin') { window.location.href = '/uye/giris?&redirect_to=/oyun'; } else { var r; r = (data.indexOf("true") != -1); } if (r) { wgame(); } else { losegame(); } }) } }); }); $(".try").click(function () { $(".losebox").css("display", "none"); $(".box").css("display", "block"); jQuery(".savegame").css("visibility", "visible"); }); $(".try2").click(function () { $(".boxaga").css("display", "none"); $(".box").css("display", "block"); jQuery("#saved").hide(); jQuery(".savegame").css("visibility", "visible"); }); $.playgame = function (kcode) { score = eval($(".score").find("span").text()); if (kcode == 49) { pushnumber = 1 } if (kcode == 50) { pushnumber = 2 } if (kcode == 51) { pushnumber = 3 } if (kcode == 52) { pushnumber = 4 } clickedEl = $(".gamecontent li")[pushnumber - 1]; clickedElT = pushnumber; jQuery.get("/game1of3?res=" + pushnumber, function (data) { score = eval($(".score").find("span").text()); var r = eval(data); if (r) { wgame(); } else { losegame(); } }) }; jQuery.get("/game1of3"); }); cheers! I am creating a web/shopping cart using Big Commerce. I am not a programer so I need help creating a code for the following: a.- PRICING DISOCOUNTS - The variations features allows for setting prices for diferent size, colors, etc. but will not allow for price discounts. Meaning if you buy 1 ea the price is $10.00 ea 2 $ 8.00 ea or 5 or more $ 7.00 ea. We sell health supplements so Price Discounts are important. Tech support said I needed a simple java cript code written. Need to give a set $$ discount or % discount to all products or individually as required. Can anyone help? I just started a small business but I am willing to pay some for quick delivery. Thank you very much. J.C. I'm trying to get a drop down box to change the image i've managed to get it working for one but can't seem to get it working when both scripts are on. any help would be much appreciated! http://humza-productions.co.uk/test/ this is the code i'm using, it's for the baseball jacket one but the one that's working live on the website is currently working for the hoodie Code: <script type="text/javascript"> window.onload=function() { bp='images/', //base url of your images imgnum=3, //Number of your images. This should match on your comboboxes options. thumb=document.getElementById('sho1'), //id of your image that will be changing combobox=document.getElementsByName('os1')[0]; // id of your combobox. combobox.onchange=function() { thumb.src=bp+'shop'+this.value+'.png'; } } </script> Hello i have problem is i have penny auction script and i try to add auction and it show on indexpage assume 05-05-2011 but when the time hit 00.00 so date become to 6 and back to 5 in the morning maybe 12 hour and i try to change var.match round to var math.floor date become to 4 before midnight 2 minute and back to 5 when the time hit midnight again...so if this day is 5 and before midnight it will not become to 4 but when midnight come it will become to 6...so i dont know when item can end then this is code if someone can sort it out function calc_counter_from_time22(diff) { if (diff > 0) { hours=Math.floor(diff / 3600) minutes=Math.floor((diff / 3600 - hours) * 60) seconds=Math.round((((diff / 3600 - hours) * 60) - minutes) * 60) } else { hours = 0; minutes = 0; seconds = 0; } if(diff < 86400){ return twodigit(hours) + ":" + twodigit(minutes) + ":" + twodigit(seconds); } else{ var Tday = Math.floor(diff / (60 * 60 * 24)); var addDay = Tday; var d = new Date(); d.setDate(d.getDate()+addDay); mkMonth=d.getMonth()+1; mkMonth=new String(mkMonth); if(mkMonth.length==1){ mkMonth="0"+mkMonth; } mkDay=d.getDate(); mkDay=new String(mkDay); if(mkDay.length==1){ mkDay="0"+mkDay; } mkYear=d.getFullYear(); return mkDay+"-"+mkMonth+"-"+mkYear; } Code: <script type="text/javascript"> var aURL = "http://xmegatop100.com/"; if (aURL == http://xmegatop100.com/) { document.write("<p style="text-align: right;"> <a href="{$list_url}/index.php">1-50</a> | <a href="{$list_url}/index.php?start=51">50-100</a> | <a href="{$list_url}/index.php?start=101">100-150</a> | <a href="{$list_url}/index.php?start=151">150-200</a></p> <br><br> "); } else { document.write("<p style="text-align: right;"> <a href="{$list_url}/index.php?cat={$category_url}&start=1">1-50</a> | <a href="{$list_url}/index.php?cat={$category_url}&start=51">50-100</a> | <a href="{$list_url}/index.php?cat={$category_url}&start=101">100-150</a> | <a href="{$list_url}/index.php?cat={$category_url}&start=151">150-200</a></p> <br><br> "); } </script> What im trying to do is if i have url as http://mysite.com then read1 code , if my site has http://mysite.com/index.php?cat=~~~~ Then reads the else part.. am i doing something wrong? this doesnt work.. |