I've got a need to hide a function from ie6 (long story). Does anyone know how I can target that browser and stop the rest of the script from processing?
I looked at using jQuery.support but am not able to find a test that returns false for ie6 only
. I want to wrap my function in some type of conditional that stops ie6 in it's tracks but all other browsers can process. Something like this:
I am trying to hide/show table when hide/show button is pressed
Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.
I'm using jQuery 1.4 to hide a div (#cartPop) when the "close" link inside of it (#cartPop a) is clicked. Since I'm using animate() to fade the div out (opacity), I also have to use hide() to get rid of the div once it has faded out (otherwise the invisible div, which is on a higher z-index, blocks the elements on a lower z-index).
Code:
The problem is that the hide() function calls immediately without waiting for the animate() function to run. Even if I append a delay() function before hide() like so:
I'm building a website, and use your framework to hide/show a div. This work, but in IE when click to hide/show the div, the background became black, instead to maintaine the image with alpha properties. In Firefox, Opera and Chrome works fine.
I have a simple FAQ show/hide function set up however I am having trouble setting up an if clause. My code is: $(document).ready(function(){ $("dd").hide(); $("dt").click(function(){ $("dd").hide('slow'); $(this).next().slideToggle(); }); });
However, when you click on the same item twice it firstly hides and then reshows it, I need an if statement that basically states; if "this?!" is visible/shown Then do nothing else $("dd").hide('slow'); $(this).next().slideToggle(); I am unsure of the syntax and can't figure out what property I can trace out to see if the item is being shown or not.
Is there any way that I can make it so it hides all divs and then toggles the one I want WITHOUT having to write it out like this. is there a 'hide all' option?
I have a hidden spinner div. When my jquery function is called -- I show the spinner. But, how do hide I the spinner div after the ajax request has completed?
$(function() { $(".pagination a").live("click", function() { var loader = $('#loader') loader.show() // <-- hidden loader div
I have 2 divs on the page, div1 has a gif animation in it and div2 is the page content. I want to hide div2 and only show div1 which plays the gif, then after some time div1 fades away and div2 fades up to show the page content.
This is my thought process:
1) On doc ready, hide div2 2) after 3000 fade div1 out 3) fade div2 in
$(document).ready (function(){ $('#div2')hide();
but I dont know how to fade out the div after a time and fade in the other div.
I have a table that Im hiding during the initial load that has a considerable amount of data. (I dont design'em, I just code 'em).
During the .show, .hide ... functions I would like to display a please wait msg. But I cant seem to find a way to do an async function. As the callback functions only deal with sync ...(I think)
Anyway, I am using some code that someone else wrote so I claim no credit here for the code.It works great and I've managed to persuade to work in Wordpress but I have one thing I would like to change.Basically the text I am trying to toggle is "shown" on page load - I would like it to be "hidden" until the user clicks on the link to make it appear.Here's the code:
just started using jQuery,and i'm having a problem using the function .show()/.hide() to make a div appear and disapear when a certain option value is selected.It's working fine in firefox but not working at all in chrome and IE 8.This is the function code i'm using :
I have a function that uses the ajax load function to post off some parameters and fill a div with the returned content after a db query has been run to create it. This all works fine, however I would like to be able to replace the div with a loading graphic whilst the content is generated. I assumed this was done by placing the graphic at the start of the function, then using a callback function to remove it and display the actual data once it has been fully generated...
However when I trey to implement this I am getting a strange result in that the callback fires before the content is generated. So my loading graphic disappears and then the content appears sometimes 10 seconds later. How can I ensure the call back only executes once the new content is ready to be displayed ??
Here's my code ... function get_report(){ // Hide #report_here div and show loading graphic here ... $("#report_here").load("/admin/reports/statistics_report/", { // Parameters sent go here }, finished() ); function finished() { // Hide loading graphic and show #report_here div here ... }
I need an 'unobstrusive DOM' function which will show and hide a piece of text within the DIV activated by links. Can anyone help me find a suitable function?
<div id="formatting"> <h3>Formatting options</h3>
<dl> <dt>Bold</dt> <dd>[b]text[eb]</dd> <dt>Italic</dt> <dd>[i]text[ei]</dd> <dt>Link</dt> <dd>link [l=url]text[el]</dd> <dt>Line break</dt> <dd>single new line</dd> <dt>Paragraph</dt> <dd>double new line</dd>
The below is a menu, which is hidden until clicked, and can be hidden by clicking it again.
<!-- This goes in the HEAD of the html file --> <script language="javascript"> <!-- function showIt() { if (document.layers) {document.layers["layer1"].visibility='hide'} else {document.all["layer1"].style.visibility='hidden'} } function hideIt() { if (document.layers) {document.layers["layer1"].visibility='show'} else {document.all["layer1"].style.visibility='visible'} } // --> </script>
<span id="layer" style="position:absolute; top:17; left:20; width:250; height:90; visibility:show"> <script> <!-- author: bfsog@hotmail.com use it as you wish //--> <!-- function buttonText(type) { if (type=="Hide Menu ") {document.menu.button.value="Menu";} else {document.menu.button.value="Hide Menu ";} showIt(); if (document.menu.button.value=="Hide Menu ") {hideIt();} } // -->
<!-- change the value of 'top' and 'left' in the layers properties below to place the menu in the desired position matching the placement of the button --> </script>
I have a script to show and hide various divs based on a function & var. The problem I am having is that when ANY of the variables ('hate', 'ok' and 'love') are passed all 3 different feedback forms ('FeedbackHate', 'FeedbackOk' and 'FeedbackLove') appear, not just the one I want.
Here is the JS: function sitesurveyswitch(emotion) { var e = emotion; document.getElementById('site_survey_hate').style.backgroundPosition = '0px 0px'; document.getElementById('site_survey_ok').style.backgroundPosition = '0px 0px'; document.getElementById('site_survey_love').style.backgroundPosition = '0px 0px'; document.getElementById('FeedbackHate').style.display = 'none'; document.getElementById('FeedbackOk').style.display = 'none'; document.getElementById('FeedbackLove').style.display = 'none'; if (e == 'hate') document.getElementById('site_survey_hate').style.backgroundPosition = '-80px 0px'; document.getElementById('FeedbackHate').style.display = 'block'; if (e == 'ok') document.getElementById('site_survey_ok').style.backgroundPosition = '-80px 0px'; document.getElementById('FeedbackOk').style.display = 'block'; if (e == 'love') document.getElementById('site_survey_love').style.backgroundPosition = '-80px 0px'; document.getElementById('FeedbackLove').style.display = 'block'; }
And here is the code related to this function: <div id="siteSurveyBox"> <span id="site_survey_hate" onclick="sitesurveyswitch('hate');return false;"></span> <span id="site_survey_ok" onclick="sitesurveyswitch('ok');return false;"></span> <span id="site_survey_love" onclick="sitesurveyswitch('love');return false;"></span> </div> <div id="FeedbackHate" style="display:none; margin-top:-28px;"> FEEDBACK FORM IS HERE </div>
<div id="FeedbackOk" style="display:none; margin-top:-28px;"> FEEDBACK FORM IS HERE </div> <div id="FeedbackLove" style="display:none; margin-top:-28px;"> FEEDBACK FORM IS HERE </div>
I am very new to javascript and html. I am trying to create a function which will hide or show a div (div1). Right now, it is always showing the div whether the boolean value is true or false. I know that it is getting inside the else if part, but it doesn't seem to be working.
<script type="text/javascript"> function hideDiv(flag){ if (flag == false){ document.getElementById('div1').style.visibility="visible"; }else if (flag == true){ document.getElementById(div1).style.visibility="hidden"; }} var bool = new Boolean(true) hideDiv(bool); </script><body> <div id="div1"> Text! </div></body>
So in the past I've mostly just copy and pasted other JavaScript functions I needed, and made slight modifications based on my exact needs. However, this time I couldn't find anything that would work with what I wanted to do (show and hide comments on news stories in a particular way), so I decided to just make my own.After a few hours of messing around with it, I'm quite exasperated, because what I have looks like it should work, but for some reason I can't identify, doesn't.Essentially what it should do is, find the table with the ID of the news article whose comments are being toggled, then find all the rows in the table that are labeled as comments, and either show them or hide them, based on their current state (as defined by their class with a "display: none;" in it or not).
Obviously it uses PHP, but I know that's not the problem; it just uses the article's ID number to pass on which comments need to be hidden/shown to the function.From everything I've looked up, this should work, but doesn't. Something peculiar, though, is that the function looks like it's not even being called; I put a simple alert('Test'); in the function, and still nothing happened when I clicked the link. So maybe my function is fine in itself, but I'm just calling it in an incorrect manner?
I have two left floated divs - in the left div I want a series of drop downs (possibly check boxes as well) about a series of products. When the user makes their decision and presses submit, I want the form to submit to a javascript function that says "Right, you will need, from your responses, product C" and in the right hand floated div, a series of hidden product info divs whose visibility is changed depending on which product the function determines is the one for you.
Broken down into parts I think I need to do the following:
a) Standard HTML form with drop downs etc and submit
b) Hidden divs
c) Submission process locally to javascript function to determine which product to show/hide
d) Javascript function that makes the decision
e) Javascript that hides/shows products
Unfortunately a server side option is not available; it has to be a client side solution and I only could think of javascript. I can probably handle all bar c) and d)
I'm learning how to use Javascripts and using Prototype framework by following a step by step tutorial from a book. Unfortunately when I stepping through the following code:[code]
I have a simple hide and fadeIn. When you rollover a word it will reveal the definition. The problem I am having is if you move the mouse around quickly from one word to the next word sometimes it gets hung up and a definition will not hide. The result gives this hanging defintion and whatever the other definition the mouse is rolledover.
Here is the code I'm using:
There are about 70 words in a box with the definition being reveals on the right hand side. Is there a way of making sure there is always only one definition being shown?
I have a table that contains many rows, some in italian with code <td nome='riga_i'>. and some in english with code <td name='row_e'>. I have created two buttons with different background flags: italy and uk, so when one pushes the button with flag uk, the html page will be reloaded with only english rows, and when one pushes the button with flag it, the same page is reloaded containing only italian rows. All the code posted here works well, but I think that the code can be better because to reach this result I had to dupplicate the same function and I don' t like this.
Here the code:
To better the code I have tried in this way but without success ...