I need to get the page to reload with the anchor in the link when it is clicked in a dropdown menu. For example if I am on 'www.domain.com/about/#2' and I then click on 'www.domain.com/about/#3' the url changes but the page doesn't reload so I need the page to reload, but keep the new anchor (#3).I gave the links with anchors a class of 'reload' and tried this:
I need a counter that will display beside a link, with the number of times the same link has been clicked. I do not have FTP access to the site, since it is based on a CMS.
This is my FIRST attempt at using Jquery to make a site menu for a client, and I'm pretty new to Javascript as a whole..I have a two column horizontal menu, and when an anchor on the left column is clicked it brings up a list in the right column..how do I hide list in the left column when a different anchor is clicked, bringing the new list to the top of the column?
I basically have many anchor links where when I click each of them it slidesdown its own div with some text in it. So have I wanted is when I click on one link it will show me the current one and hide the others. This is what I have tried which works great but when I click on a link it opens the div, then click on another one opens the div with one click and when I go back to re-click the previous link I have to double click it in order to work..
This is my js code: $(".anchorlink").toggle( function() { var cont_val = $(this).attr("id"); $("div#unique_anchor_text", this).show(); $("div#unique_anchor_text").hide(); $('.unique_anchor_text'+cont_val).slideDown("fast"); }, function() { var cont_val = $(this).attr("id"); $('.unique_anchor_text'+cont_val).hide(); });
HTML looks like: <a class='anchorlink' id='$item'>Comment</a> <div id='unique_anchor_text' class='unique_anchor_text$item'>some text</div>
onClick="function(' whats the value of the anchor tag just clicked? Title basically says it. I need to get the object that was just clicked, to insert into a JavaScript function. I've tried "function('this')" and similar things, but it doesn't work. I'm sure this is REALLY easy to do, but I don't know it and I have no idea what to search for.
as you can tell by the following statements, i'm new to jQueryI'm trying to do the following (in plain english) without too much success.. ) when document ready.. 2) find the element with id 'next'.3) pull / take all 'li' elements, and perform so and so, all whilst excluding 'last' element.
$(document).ready(function() { $('#next').click(function() { $('li').each(function() { //for each li ..
The <a> is a list of menu items that when clicked.... a specific gallery-slider-images should been shown in relation to the galleryId....<div class"gallery" is hidden in CSS> I'd like to use jQuery to complete this task if at all possible, i can't seem to .show() the selected 'gallery' w/o showing them all...........
I need to get the object that was just clicked, to insert into a JavaScript function. I've tried "function('this')" and similar things, but it doesn't work.
I recently had a request from a client and I'm not entirely sure this is possible. I'll try to explain it the best I can, as I can't share the development files yet...
We have a page with an image map of the United States. If anyone clicks on a state, it will bring them to a new
page. This new page contains a table that has named anchors on it, each row being a different state.
So, for example, if someone clicks on South Carolina on the map page, they will be brought here[code]...
The #sc anchor will scroll the new page down to the row in the table about South Carolina.
Is there any way to highlight the table row that the person is looking for? For example, if they click on South Carolina, they will be brought to this new page and the South Carolina row in the table would be highlighted.
I have a simple a tag in html that when clicked I want to link to a random address picked from an array of possible links.
So in the code here I have an array of the links and I'm picking a random number from the length of that array, I'm then using that number to pick a random link from the array.
Code: <script type="text/javascript"> var links_arr = ["http://www.link1.com","http://www.link2.com","http://www.link3.com","http://www.link4.com"]
[Code]....
This all works fine and the window.alert show randomly picked links from the array.
The problem is passing the link to the href of the a tag - how can I use the link in the href ?
I create a new page and write to it. There is an anchor in the new page so that users can easily navigate to the bottom. In IE, it works fine. In Firefox, it loads the parent page into the new page....
I did a search of the forums, and this was the only thing I could come up that seems similar: [URL]. The last post in this thread tells me what I already know from my other research today - this function doesn't work in FF, Safari, etc.
Works great in IE, but nothing else. I'm using a jQuery gallery tool called fancybox, and from what I can gather, the popup of the gallery must be tied to a click on an anchor link.
On their support forums, one of their admins suggested that I use the following: Code: <script type='javascript'>setTimeout( function() {$ ('#popupLink').trigger('click'); }, $timeleft);</script>
Still doesn't work (not even in IE). BTW, $timeleft is a var that is being created in PHP. I've checked the source code and it is counting down correctly.
I have an Iframe which loads an articles html page with anchors at the start of every article. To the right is fixed div that has different article links. The customer can scroll down and read all the articles. I would like the links to change to active, visited etc. when the anchors come into view. I was thinking it would be something like this:
Code:
function changelink(){ if(window.location.href='#article3'){ document.getElementById('historylink').style.color='green'; historylink.style.background='url(sources/active.jpg)center';
[Code]...
Haven't tried it yet because it dosen't take into account the visited state of the links so I figured I need some advice from the skript Gods.
When you click a link it jumps to an anchor point on the page and scrolls there smoothly. I was wondering how I get the same effect if I want the link to jump to another page? A normal anchor point on another page would set the href to, for instance, 'index.html#contact' but it won't work in this case as the javascript isn't reading the '#'. <script type="text/javascript" src="jquery.js"></script> <script> function goToByScroll(id){ $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow'); } </script> </head> <body> <ul> <li><a href="javascript:void(0)" onClick="goToByScroll('contact')">Go to anchor 1</a></li> </ul>
Lets say I have a bunch of links with the same class but different anchor text like [code] When the page loads I want the anchor text of each link to display the same text of my choosing. However, when the visitor clicks a link the anchor changes back to the orignial. It would be best if all links could be changed back their original if any link is clicked but this isn't necessary.
I have a list item, where only some of the items are linking to a quote from the client. The quotes are in another list, where each list item has an id corresponding to the client link. I want to show the client quote when you roll over the client anchor link. Currently when I mouseover it's showing nothing.
At the moment, when I mouseover one of the anchored client links, the content disappears, so it's not showing the correct client quote <li>. $(document).ready(function() { // see if the requested page url contains an anchor '#' var hash = window.location.hash.substring(1); // if no anchor, show the default blockqoute if(!hash){ var id = 'default'; }else{ var id = hash; } .....
How can I detect when a link has been clicked but the new page is still in the process of loading? The document.location.href property still displays the current location (understandably) not the one that's about to load.
I have a page that reloads every 30 seconds in order to access live data. If a user clicks on a link just prior to the page reloading the reload takes precedence over the link click and this is annoying for the users. Whe the page is about to reload I want to check to see if a link has just been clicked (and therefore a new page is about to load) and, if so, cancel the reload.
I have a page with several links that when clicked open a modal window. The same window for each link, with a form. However inside the form I need to print the id of the link that was clicked. Like so: