JavaScript - Firefox Won't Run My Jquery
Ok, so I spent all my time making this website http://portfolio.dreamsofatypewriter.com/index.html work on IE. And now it turns out it is Firefox that is trying to ruin me.
I am using a simple JQuery by Sam Dunn to slide boxes on the upper left of the landing page. But in Firefox (may be it is just FFX4) it won't run. I can't fathom what can be the problem. Any thoughts? Thanks Sandeep Similar TutorialsHey all, 1) When clicking on a list in an accordion, it should change the quicktime movie playing in a main window area. It works in firefox but not in safari. The variable imgTitle holds the expected output (e.g. '../images/Intro-1.mov'). It changes the src attribute of the embed tag. This change works in Firefox where the new movie plays on click. However, when clicking the list item in safari, nothing happens. 2) There is a problem in firefox as well in that the movie overlays everything else on page, even though it should be behind the text. Positioning would be tedious given that there's many nested elements and I would have to set relative positioning to the entire page. Any reason for this behavior of embed tags? Code: $(".image_thumb ul li ul li").click(function(){ var imgTitle = $(this).find('a').attr("href"); var imgDesc = $(this).find('.block').html(); var imgDescHeight = $(".main_image").find('.block').height(); if ($(this).is(".active")) { return false; } else { console.log(imgTitle); $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() { $(".main_image .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 ); $(".main_image embed").attr({ src: imgTitle}); }); } $(".image_thumb ul li ul li").removeClass('active'); $(this).addClass('active'); return false; }) .hover(function(){ $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); Thanks for response. So, i have this code which retrieves php files for me using jquery and id love to get it working with Jquery history plugin. I tried modifying the code i got from the ajax demo to work for me, but i just couldnt do it as i do not know any javascript really.. ( actually what i tried was simply to change "#ajax-links a" to "#menu li a" and .html to .php ..but nothing.. :rolleyes: Id be very gratefull if someone would help me out with this one. All related code can be found bellow (the ones that should be needed anyways): This is the code that retrieves php files inside "#content" when item from "#menu li a" with the specified id is clicked Code: $(document).ready(function(){ //References var change = $("#menu li a"); var loading = $("#loading"); var content = $("#content"); //Manage click events change.click(function(){ //show the loading bar showLoading(); //load selected section if(this.id == "home") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/index.php", hideLoading); content.slideDown(); } else if(this.id == "secondpage") { change.load(this.className='current-page'); content.slideUp(); content.load("pages/secondpage.php", hideLoading); content.slideDown(); } else { //hide loading bar if there is no selected section hideLoading(); } }); //show loading bar function showLoading(){ loading .css({visibility:"visible"}) .css({opacity:"1"}) .css({display:"block"}) ; } //hide loading bar function hideLoading(){ loading.fadeTo(1000, 0); }; }); Heres the structure of the menu/content Code: <ul id="menu"> <li><a id="home" class="normal" href="#Home"></a></li> <li><a id="secondpage" class="normal" href="#Secondpage"></a></li> </ul> <div id="content"> <ul id="sec-menu"> <li><a id="link1" class="normal" href="#">Link1</a></li> <li><a id="link2" class="normal" href="#">Link2</a></li> </ul> </div> Heres the code that jquery history plugin uses in demo for ajax Code: jQuery(document).ready(function($) { function load(num) { $('#content').load(num +".html"); } $.history.init(function(url) { load(url == "" ? "1" : url); }); $('#ajax-links a').live('click', function(e) { var url = $(this).attr('href'); url = url.replace(/^.*#/, ''); $.history.load(url); return false; }); }); hi, i have a jquery problem... this script is not working with jquery-1.4.2.min, but it works with jquery-1.2.6.min.js, can anyone help me???the script is the above: (it is not working the tab actions, the slideout works...) http://www.benjaminsterling.com/wp-c...es/sidetab.htm the javascript code is the above: PHP Code: var jqsideTabs; var tabs, h = 50, r = 0,ra = 0; $(document) .ready(function(){ jqsideTabs = $('#sideTabs').addClass('closed'); tabs = jqsideTabs .find('.tab h3') .clone() .appendTo(jqsideTabs) .each(function(i){ var that = $(this), cls = '',ow,newThis, newEl; if( i == 0 ) cls = ' active'; newEl = $('<a href="#" class="tabLinks'+cls+'">' + that.text() + '</a>'); that.replaceWith(newEl); ow = newEl.outerWidth(); if( i == 0 ) ra = ow; else r = ow; h = newEl.css({'top':h , 'right': -ow }).height() + h; newThis = newEl.get(0); newThis.jq = newEl; newThis.i = i; newEl.click(function(){ var el = this.jq; if( jqsideTabs.hasClass( 'closed' ) ){ jqsideTabs.removeClass('closed'); } else if( !jqsideTabs.hasClass( 'closed' ) && el.hasClass('active') ){ jqsideTabs.addClass('closed'); } el .siblings() .removeClass('active') .css({'right': -r }) .end() .addClass('active') .css({'right': -ra }); tabs.eq( this.i ).show().siblings('.tab').hide(); return false; }); }) .end() .parent() .eq(0) .addClass('active') .end() .filter(':not(:eq(0))') .hide() .end(); jqsideTabs.bind("mouseleave",function(){ jqsideTabs .animate({left:-310}, 'fast', function(){ jqsideTabs.addClass('closed').removeAttr('style'); }); }); }); and the html file is: [HTML] <div id="sideTabs"> <div class="tab"> <h3>Tab 1</h3> <div class="gut"> <p>Some text</p> </div> </div> <div class="tab"> <h3>Tab 2</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> <div class="tab"> <h3>Tab 3</h3> <div class="gut"> <ul> <li>link</li> </ul> </div> </div> </div> [/HTML] the problem is that the tab button works, but the content doesnt change...in all of tabs showing the same text(showing all tbas content).... can anyone help...please..... i keep getting the error GET http://code.jquery.com/jquery.min.map net::ERR_TOO_MANY_REDIRECTS & Failed to load resource: net::ERR_TOO_MANY_REDIRECTS when i load my page...and the havascript doesn't work properly on ym page...how do i resolve this. thanx in advance var s="attr" var i=$(s) // jQuery(elem).attr(attr,eval("elm"+attr)); jQuery(elem).$(s)(attr,eval("elm"+attr));//i tried this. how to assign a variable name in the above code(in place of s) so that i need to add an attribute to the element "elem". Ok, I would post my entire data here but then yall would be reading insane amounts of script. I've got a div content jquery slider on my site I am making and it works beautifully in all browsers(took me a while). Then, I decided why not have it where when people click on a "read more" link that it pops up a box, instead of directing to the new page, and displays the contents of a div. It would not work at all. My question is there a possible way to do this?
i am a newbie to jquery and need help. i want to alert anything when i click at any button that have the class .resetBtn using jquery. I know doing it with javascript is much easier but i learning jquery so trying to create function by myself. my code currently does not work when i click on my button. Code: $(".resetBtn").click(function() { alert ("asd"); }); i want get value form path : ex.. xxx.com/index.php?cat " cat " read cookie with jquery who? Hi Guys, Please check this link out. I'm curious if you can attain the same functionality with jquery. Which include the hover over effects and sliding. If this can be done can you point me in the right direction to find some documentation to start learning. Thanks. http://www.gensler.com/#projects Hi, I have this js script which is working on mouse click, what is my requirment is that it do the same function wiht on mouse over: click: function(e) { var el = this; el.blur(); // if the image was not preloaded yet then wait if (el.zoomimageCfg.loading === true) { return false; } //zoom it in if not zoomed already if (el.zoomimageCfg.zoomed == false) { EYE.zoomimage.zoomIn(el); //else zoom it out } else { EYE.zoomimage.zoomOut(el, false); } return false; }, Thank you Best Regards, mnightwalker Hi All, i have an autosuggest feature on my site where the user searches for a product and as they type it lists matching products from my database. here is the javascript/jquery code Code: $(document).ready(function(){$(document).click(function(){$("#ajax_response").fadeOut('slow');});$("#keyword").focus();var offset=$("#keyword").offset();var width=$("#keyword").width()-2;$("#ajax_response").css("left",offset.left);$("#ajax_response").css("width",width);$("#keyword").keyup(function(event){var keyword=$("#keyword").val();;if(keyword.length) {if(event.keyCode!=40&&event.keyCode!=38&&event.keyCode!=13) {$("#loading").css("visibility","visible");$.ajax({type:"POST",url:"/ajax_server.php",data:"data="+keyword,success:function(msg){if(msg!=0) $("#ajax_response").fadeIn("slow").html(msg);else {$("#ajax_response").fadeIn("slow");$("#ajax_response").html('<div style="text-align:left;">No Matches Found</div>');} $("#loading").css("visibility","hidden");}});} else {switch(event.keyCode) {case 40:{found=0;$("li").each(function(){if($(this).attr("class")=="selected") found=1;});if(found==1) {var sel=$("li[class='selected']");sel.next().addClass("selected");sel.removeClass("selected");} else $("li:first").addClass("selected");} break;case 38:{found=0;$("li").each(function(){if($(this).attr("class")=="selected") found=1;});if(found==1) {var sel=$("li[class='selected']");sel.prev().addClass("selected");sel.removeClass("selected");} else $("li:last").addClass("selected");} break;case 13:$("#ajax_response").fadeOut("slow");$("#keyword").val($("li[class='selected'] a").text());searchValue=document.getElementById('keyword').value; searchValue = searchValue.replace( /\([^\)]*\)/g, "" );searchValue = searchValue.replace(/^\s*|\s*$/g,'');searchValue=searchValue.replace(/(\s-)/gi,"");searchValue=searchValue.replace(/\s/gi, "_");searchValue=searchValue.replace(/[:',]/gi,"");window.location="/CDs/"+searchValue.toLowerCase();break;}}} else $("#ajax_response").fadeOut("slow");});$("#ajax_response").mouseover(function(){$(this).find("li a:first-child").mouseover(function(){$(this).addClass("selected");});$(this).find("li a:first-child").mouseout(function(){$(this).removeClass("selected");});$(this).find("li a:first-child").click(function(){$("#keyword").val($(this).text());$("#ajax_response").fadeOut("slow");});});}); this runs this php script to get the product names PHP Code: <?php session_start(); include("config.php"); $keyword = $_POST['data']; $keyword = preg_replace("/s*\(.*\)/i", "", $keyword); $keyword = ucwords($keyword); $sql = "select DISTINCT prodName,prodShortName,prodCategory from ".$db_table." where (".$db_column." like '".$keyword."%' AND prodCategory = '".$_SESSION['subpage']."') limit 0,10"; $result = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($result)) { echo '<ul class="list">'; while($row = mysql_fetch_array($result)) { $category = strtolower($row['prodCategory']); $str = ucwords($row['prodName']); $start = strpos($str,$keyword); $end = similar_text($str,$keyword); $last = substr($str,$end,strlen($str)); $first = substr($str,$start,$end); $link = "/".$category."/".$row['prodShortName']; $final = '<span class="bold">'.$first.'</span>'.$last; echo '<li><a href="'.$link.'">'.$final.'</a></li>'; } echo "</ul>"; } else { echo "0"; } ?> which works fine, what i am trying to acheive is to pull out the category of the products in the list and use it in the script. so where it says this Code: window.location="/CDs/"+searchValue.toLowerCase();break; i want the value of the php value $category to be. but i have no idea how to do this or if it is even possible? any help is appreciated many thanks Luke I'm not sure if I'm in the right place or not, but I am in desparate need of some help. I have this code: Code: <script type="text/javascript"> $(document).ready(function(){ $('#add').click(function() { alert('test'); }); $("form#exercise").submit(function() { // we want to store the values from the form input box, then send via ajax below var activity = $('#activity').attr('value'); $.ajax({ type: "POST", url: "newActiveProc.php", data: "activity="+ activity +"&func=search", success: function(activity){ $("span#results").html(activity); } }); return false; }); }); </script> As you can see by the highlighted portion, the user is alerted once they make a selection. It should go something like this: [Add to table] Football [Add to table] Basketball [Add to table] Baseball Once they click the 'add to table' button, their selection should be added to a table that is at the bottom of the page. So far, all I've been able to do is generate an alert box, but I know thats not right. Any information anyone has would be helpful. Thanks in advance. All, I have the following jQuery code: Code: $("#other").click(function(){ var checked = $(this).is(':checked'); if(checked){ $('textarea#other_text').removeAttr("disabled"); }else { $('textarea#other_text').attr("disabled", "disabled"); } }); This works fine. However, what I'm allowing the users to do is edit this field. So I have the following PHP code: PHP Code: <input type="checkbox" name="other" value="x" id="other" <?php if($resultsetedits['other']=="x"){ echo "checked"; } ?>> Other:<br>If you choose other, please explain what other options you'd like us to do to your photo:<textarea name="other_text" rows="3" cols="119" id="other_text" disabled><?php if($resultsetedits['instructions']!=""){ echo $resultsetedits['instructions']; } ?></textarea> Since the checkbox is checked with the PHP code the click function to jQuery never gets invoked and my textarea remains disabled. Is there anyway to basically invoke the jQuery code with my PHP script? Thanks in advance. I'm not sure if this is something jquery can do or what but here's what I want to do but I have this following code and when it shows either Public or Archived for the Event Status I want it to be a link so that if I click on Public then it turn it into Archived because it'll change its status_id in the DB from 4 to 5. PHP Code: case 1: echo $e; ?> <h1 class=backstage>Archiving Management</h1><br /> <h2 class=backstage>Weekly Events</h2><br /> <?php $query = "SELECT ecb.bookingdate, els.name, ele.statusname, ecb.label FROM `efed_content_booking` AS ecb LEFT JOIN `efed_list_shownames` AS els ON ( ecb.event_id = els.id ) LEFT JOIN `efed_list_eventstatus` AS ele ON ( ecb.status_id = ele.id ) WHERE els.type = 'singular' OR els.type = 'recurring'"; $result = mysql_query ( $query ); $rows = mysql_num_rows($result); if ($rows > 0) { print'<table width="100%" class="table1"> <tr class="rowheading"> <td>Event</td> <td align="center">Booking Date</td> <td align="center">Event Status</td> </tr>'; $i = 0; while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) { $sClass = 'row2'; if ($i++ % 2) $sClass = 'row1'; printf ( "<tr class=\"%s\">", $sClass ); printf ( "<td valign=\"top\">%s%s</td>", $row['name'],$row['label'] ); printf ( "<td valign=\"top\" align=\"center\">%s</td>", convertdate($row['bookingdate'] )); printf ( "<td valign=\"top\" align=\"center\">%s</td>", $row['statusname'] ); echo '</tr>'; } echo '</table><br>'; } else { echo '<span>There are no weekly events to archive.</span><br /><br />'; } ?> <h2 class=backstage>Pay-Per-View Events</h2><br /> <?php $query = "SELECT ecb.bookingdate, els.name, ele.statusname, ecb.label FROM `efed_content_booking` AS ecb LEFT JOIN `efed_list_shownames` AS els ON ( ecb.event_id = els.id ) LEFT JOIN `efed_list_eventstatus` AS ele ON ( ecb.status_id = ele.id ) WHERE els.type = 'ppv'"; $result = mysql_query ( $query ); $rows = mysql_num_rows($result); if ($rows > 0) { print'<table width="100%" class="table1"> <tr class="rowheading"> <td>Event</td> <td align="center">Booking Date</td> <td align="center">Event Status</td> </tr>'; $i = 0; while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ) { $sClass = 'row2'; if ($i++ % 2) $sClass = 'row1'; printf ( "<tr class=\"%s\">", $sClass ); printf ( "<td valign=\"top\">%s%s</td>", $row['name'],$row['label'] ); printf ( "<td valign=\"top\" align=\"center\">%s</td>", convertdate($row['bookingdate']) ); printf ( "<td valign=\"top\" align=\"center\">%s</td>", $row['statusname'] ); echo '</tr>'; } echo '</table><br>'; } else { echo '<span>There are no ppv events to archive.</span><br /><br />'; } returnmain(); footercode(); break; I am using tooltip plug in on a site and when I use it on a blank template, it works then when I transfer it to the page I want to use it on it does not work. The site is Here is they javascript code: Code: this.imagePreview = function(){ /* CONFIG */ xOffset = 10; yOffset = 30; // these 2 variable determine popup's distance from the cursor // you might want to adjust to get the right result /* END CONFIG */ $("a.preview").hover(function(e){ this.t = this.title; this.title = ""; var c = (this.t != "") ? "<br/>" + this.t : ""; $("body").append("<p id='preview'><img src='../"+ this.href +"' alt='Image preview' />"+ c +"</p>"); $("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px") .fadeIn("fast"); }, function(){ this.title = this.t; $("#preview").remove(); }); $("a.preview").mousemove(function(e){ $("#preview") .css("top",(e.pageY - xOffset) + "px") .css("left",(e.pageX + yOffset) + "px"); }); }; // starting the script on page load $(document).ready(function(){ imagePreview(); }); Here is the HTML code. Code: <ul> <li><a href="mailto:rragon@cumberland.k12.il.us">Mr. Russell Ragon</a> <a href="../../Images/staffbios/rragon.gif" class="preview"><img src="1s.jpg" alt="BIO" /></a></li> </ul> Here is the CSS code: Code: #preview{ position:absolute; border:1px solid #ccc; padding:5px; display:none; color:#fff; background-color: #333; } This is my first post on this forum so I hope the code is clear you can check out the site up above just hover over one of the names. I am only getting image preview instead of the image I want. Ont thing I did do was I took out the image so I could get the Alternate code. My objective here is to have a name and when you hover over it an image pops up and on the image will be a biography of the teacher. Thanks for any help. Hi guys, ben using jQuery GalleryView (1.4 and 2.1) to good effect but recently been asked to incorporate an XML file to build up the image list dynamically. The XML contents will be in the format: Code: <MediaProxy><thumbnail>some_location.jpg</thumbnail></MediaProxy>... I can parse the XML: Code: <script type="text/javascript"> $(document).ready(function() { $.ajax({ type: "GET", url: "list-images.xml", dataType: "xml", success: parseXml }); }); function parseXml(xml) { $(xml).find("MediaProxy").each(function() { $("#photos").append('<li><img src="' + $(this).find("thumbnailUrl").text() + '" alt="'+$(this).find("caption").text()+'" />'); } ); } </script> I have a UL tag ID photos like my standard implementation but I don't know where to include the relevant jQuery scripts or the Galleryview parameters: Code: $(document).ready(function() { $('#photos').galleryView({ panel_width: 480, panel_height: 281, frame_width: 40, frame_height: 20, transition_interval:14000, transition_speed:600, pause_on_hover: true, filmstrip_position: 'bottom', frame_scale: 'crop', show_panels: false }); }); An example of how it should work (with images hard coded into the list) is: XML-Parse2 And the work in progress file is: XML-Parse Any help appreciated. D. hi guys! i was building a website using two jquery codes . first one for the slideshow banner and the other one for the menu but only one of them works, i've search on the web and i fouond something called jquery no conflict() is this good? this is the code inside de <head> tags Code: <!-- JavaScripts--> <script type="text/javascript"> jQuery.noConflict(); </script> /*This is the menu's*/ <script type='text/javascript' src="jquery-1.2.6.min.js"></script> <script type='text/javascript' src="kwicks.js"></script> <script type='text/javascript' src="custom.js"></script> /*Here starts the sideshow*/ <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/s3Slider.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#slider').s3Slider({ timeOut: 3000 }); }); </script> </head> I am having a problem with a page I am building using jquery tabs. I have basically put a set of tabs within another set. The top level of tab navigation works fine, but then you click on the tabs navigation within the first tab it doesnt work. http://dl.dropbox.com/u/14080718/Final/TabsInTabs.html I cant get it to work and not sure why. I am still learning web design and I am not sure if this is a html/css or jquery problem. I would appreciate any help anyone wants to give. Thanks, |