I'm using mootools-core-1.3.2.js to hide/show a div tag. Now what I want to do is : * slide the div tag away (done and works);* get the value from the "horizontal_status" and put in in PHP var to toggle something else
Here's the javascript code:
<script type="text/javascript">
window.addEvent('domready', function() {
var status = {
'true': 'open',
To say I'm new to JavaScript is a bit of an understatement so bear with me. I have a site set up with a variety of layers of toggles. When you enter the site all of the items are collapsed and you click the headings to expand. Each of the toggle-able items have ids. It works great for users who start at the homepage.
However, when I send people to any of the inner topics, all they see is the initial collapsed state of the site. I want to be able to provide a URL that will set the toggle to open, and show all of the content for that section on entry.
Here is my code and js, can anyone point me in the right direction?
I have an Accordion working. To advance from section to section, I want to use both click on the Accordion bar or click a button in the section. This works so long as it is a straight pass through. (section=section+1). If the user goes back, out of sequence, to change a field in a prior section, things 'get out of whack'. I need some way to have a variable in the HTML (that does not show to the user) that identifies the Accordion section and pass it to the Accordion activate method. I currently have this in the HTML of each Accordion section.
I made a website in which I -for the first time- included some jquery code. I am totally new at this. I managed to have a menu, whose elements can be clicked, which triggers the apparition of a different "bubbles" with text inside. So far so good. But I would like to make a bubble disappear when I click on another element than the one that triggered its apparition. Explanation :
My menu is for example like: menu element 1 | menu element 2 It should do this
>> click on menu element 1 = bubble1 (it works) >> click on menu element 1 = bubble 1 disappears (it works) OR >> click on menu element 2 = bubble 1 disappears, bubble2 appears (doesn't work! there I have 2 bubbles at the same time)
I am attempting to make a menu that has a background image that changeswhen you rollover or click a menuitem. I've got the hover effect working fine with CSS, but am trying to implement the click event via jquery with the following:
My process is to reset the entire menu to the inactive state, then switch on the active state for the item that was clicked. Eventually, the item that was clicked will display its corresponding body section as well. I've tried using the CSS pseudo-class "active", but since the entire div is the link, that is unavailable. I've also tried multiple variations of addClass/removeClass, toggleClass, and setAttribute/removeAttributebut nothing hasworked so far.
I'm extremely new to jquery and trying to write a toggle function without using the built-in functionality. From what I've read, this should be a fairly straightforward exerciseHowever, I'm running an issue. My code doesn't seem to do anything. Not clear to me why because nothing is erroring out? Here's what I've got:
<html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> // we will add our javascript code here
I have a link and a div on a webpage. With the link I want to toggle the content (HTML) of the div. On toggle, I want to load the content from a PHP-file and I want it to load on the toggle, not when the webpage originally loaded (to reduce loading time on the webpage itself).
The file that is loaded on toggle doesn't have to be PHP, but it would help a lot.
I have been trying to grasp the whole 'Pass By Value/Reference' thing for a few hours now. From what i can make out:
Passing by value will make a copy of the value, pass it as a function argument and the function will store the changes, the original value is not affected. So for example:
JavaScript Code: var cost = 145;var postage = .3;var a = function() {return cost + postage;} //Using an Anonymous function for this
If you was then to pass the value of 'a' to a function argument it would copy and not change the original value.
If you pass by reference it will change the original value. When you pass a reference to a value through a series of different functions and the value is constantly being changed the change happens on the original value and can be seen outside the function.
The problem is i cannot think of how or why this would be used. I havn't got to develop many large applications so im trying to think of a few situations when passing by reference would be used.
I am using the javascript below to produce three-state mouseovers. Each link has three images that look like tabs. Image 1 is the regular image for the link. Image 2 has the rollover effect (glowing text), and image 3 is onClick - it makes the tab appear as though it has moved forward (active).
Now, this javascript works perfectly when the links do not go anywhere. However, when the links are working, the onClick effect is rendered useless - because after clicking the link, a new page loads, and the buttons are reset back to their original state.
I need the active button to keep it's "forward, active" appearance. Code:
Is there a way to tell the state of slideToggle? My problem is I have two buttons that change a div and also toggle it open/close. But if you click one button then click the other, the changes take effect and then it will close. So is there something like if(slideToggle() == open) or something along those lines?
i have a list of thumbnails that are created dynamically from a database which have an transparency state when the thumbnail is in the active state (ie when someone clicks on it)I wondered is there anyway that the first one could be set to active by default when the page initially loads. My code is below:
<script language="JavaScript" type="application/javascript"> <!-- function setMainImage(imageId) {
[code]....
I wonder how I can highlight the active thumbnail so its background remains blue until I click another one.I also like to avoid the inline JavaScript.
I am trying to make a simple alert come up stating a checkbox is checked when it changes, and then another alert for when the checkbox is unchecked. Problem is, only the alert for when the box is checked is coming up.
function displayCheckPopUp() { if(document.activeElement.checked=true) { alert("A check box has been selected");
I am using a script found on Dynamic Drive and edited it a bit to fit my needs. Its a script to toggle a content area and at the same time display a + or - depending on if the content is displayed or not. The problem, the state of the content area is saved in a cookie, but the +/- state is not. I have gone over some cookie tutorials and looked through the forums, but I just couldnt figure how to edit the code to make the +/- save state. Code:
i am getting state 0 error on XMLHTTPRequest. I am using POST method to get some information from a link hosted by the client. I am calling from a mobile application. I have added a html file in an android application and from that html file i am calling post method on the client web link using XMLHTTPRequest object. I got the information from this site that its due to cross domain access issue. And get the html file from the web server to fix this issue. But in my scenario i cannot do this. The html file is embedded in the android application.
I'm trying to get my website 'apps-limited uk' to have working 3 state mouse buttons which are selectable by tab, accesskeys, etc...For some reason the 3rd state shows fine in Safari (3.22), not at all in IE(All - IE Tester) or FF(3.0.5), and god only knows what's happening in Opera (9.63)The javascript is here at the root, and is called rollover.
I would like to add dynamic text sizing to a website. There will be three text sizes. When the default is used, only the "Increase text size" button is shown. When the maximum size is used, only the "Decrease text size" button is shown. And otherwise, both buttons are shown.
I've been working on a mockup as follows at the end, but my issue is that once I have manipulated an element of the HTML DOM, if I access it again to check it's value, I will only get the original value in the document. To do the dynamic buttons, I need to maintain some kind of state between function calls, so that I know what the current size is. Can I even do this with Javascript or am I barking up the wrong tree?
I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not help.
I have seen some example that looks at the characters entered in an input field to determine if the caps lock is on, but I was wondering if something is possible that is a bit more immediate to report the caps lock state.
I'd like to adapt some Greasemonkey scripts that I've written and have them applied to html files on the server side before the files are sent to users. I'm only looking at adapting scripts that make static changes to pages. For instance, consider a script that removes from the DOM any img that has "ad" in its src.
I'm sure there are better ways to do this and I'm not even necessarily looking for an extremely efficient solution. Mostly, I just want to know if there's an existing product that could do this or with reasonable effort could be made to do this.
Can the div report back that its css display state got changed to none? Not sure whether I am making much sense since reckon most events are triggered by user action and not the change of css display status. The idea is basically that a staticpositioneddiv shown on several pages but not others, caused by css set display:none. During hiding the div should change its state and return to the previous state when being displayed again. Is it possible to bind an event to the change of the css display state instead of user action such as clicks?
Having a navigation menu desighned in photoshop, how can I use jquery to add a active state class to my css which can use the same hover style for active menu?
I'd like to fadeIn an image when I click on an li element, but I don't seem to have the initial state of the image correct because I can't make it appear. I think the basic code is ok because if I change fadeIn to fadeOut and remove my attempts to make the image (img#bullet1Tip) invisible initially, I can click and fadeOut the image. This is my code: