JQuery :: Reload Page With Anchor When Anchor Link Is Clicked?

May 26, 2011

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:

$('a.reload').click(function() {
window.location.reload();
});

View 4 Replies


ADVERTISEMENT

JQuery :: Reload A Page And Scroll To Anchor In Another Div?

Mar 29, 2011

I'm new to jQuery and javascript but already very impressed with jQuery.I have a page divided in two columns (divs). When one clicks on the links in one column, it loads the php page in the other column. I have this working, but what i would like to do is that not only would it load the php page in the other column but also automatically scroll to an anchor in that php page

View 2 Replies View Related

JQuery :: Tabs Reload Page At Anchor?

May 21, 2009

I have got tabs working great and have set up a rotate every 5 seconds but whenever it loads a new tab (either by clicking a link or rotating to it) it moves up to the top of the page as if it was following an anchor.

View 2 Replies View Related

Get To Know Which Anchor Link Being Clicked Using Script?

Oct 2, 2009

Sorry I am new to JavaScript.

Says that a.html has two same anchor links (<a href="b.html">b</a>). The anchor links are uneditable but we could add JavaScript to the a.html.

Except for dynamic adding onclick event, any other ways could get to know which anchor link being clicked?

View 1 Replies View Related

Refresh Website After 1 Sec When Anchor Link Clicked

May 25, 2011

I need a script which will refresh the page 1 sec. After the anchor text is clicked
PHP Code:
<a href="#YourAnchor"></a>

View 1 Replies View Related

Script To Reload Page And Go To Specific Anchor

May 20, 2011

I have created a very very simple javascript that displays random text quotes. It is in Greek but here it is anyway: [URL]. It is in blogger and shows up as a gadget. My problem is that I need to make it reload by a button and at the same time go to the top of this gadget (using an anchor). The reason I want to do this is that I have been sharing this with other bloggers, but if they don't put it on top of their page, as soon as they press the button that reloads the page, they are in the top of the page and they would have to scroll down to find the quote.

I have tried to use window.location.reload with window.location.hash.
It works in Firefox, but not in IE.
I have been trying something like that:
<input type="button" value="Click to refresh" style="width: 130px" onclick="window.location.hash='#something';window.location.reload()" />
As I said, this works with Firefox, but not with IE9
Also, I can't define urls beforehand because I want other people to be able to use it to their own blog or website.

View 1 Replies View Related

JQuery :: Highlight Content Based On Clicked Anchor From Another Page?

Sep 30, 2011

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.

View 2 Replies View Related

Anchor Point - Click Link To Jump To Another Page?

Jun 17, 2011

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>

View 13 Replies View Related

JQuery :: Getting Attributes From Clicked Anchor?

May 7, 2010

oing through my learning curve now. If I have my html (being generated by a PHP MySQL call) set up as such:

<a href="javascript:void(0);" class="clickable" opendesc="<?php print $thisid; ?>"><?php print $appname; ?></a>

so where opendesc will equal 1, 2, 3, 4...how can I pass this to jquery?I tried this:

$(document).ready(function(){
$("a.clickable").click(
function(){

[code]....

View 3 Replies View Related

JQuery :: Hiding List When Another Anchor Is Clicked?

Feb 16, 2011

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?

<style type="text/css">
ul.nobulletnoindent {
list-style-type: none;

[code]....

View 2 Replies View Related

JQuery :: Anchor Links - Toggle Need To Clicked Twice

Feb 25, 2011

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>

View 3 Replies View Related

Script-Added Anchor Preventing Jump Of Doc-Coded Anchor?

Jan 9, 2010

I have a script that scans an HTML document for headers and special comment tags for the purpose of generating a left-floating/position-fixed DIV that contains the document's outline or "table of contents." Within the DIV are lists (UL element by default) whose items (LI elements) are jump-to links (A elements) to the points (headers, special points marked for inclusion in table of contents) in the document. The problem is this. I have typical HTML document with links that jump to points (usually headers) inside the document, as shown below:

Code:

<body>
<p>This is addressed <a href="#later-text">later</a> in this document
<h1><a id="later-text"></a>Header Text</h1>
<p>...
</body>

But my script, being a document outliner that finds headers in a document, inserts another anchor as a jump-to point just before the first occurrence of text in the header (inserted A element shown in red below). This somehow disables the document-coded jump anchor (shown in blue below). And it occurs in FF and IE, which suggests it is not a browser-specific issue. Why does it occur? Is there something in the HTML spec that states that two anchors to which a jump occurs are not allowed to be adjacent elements in the document?

Code:

<body>
<p>This is addressed <a href="#later-text">later</a> in this document
<h1><a id="later-text"></a><a id="jump-1"></a>Header Text</h1>

[code]....

To reproduce what I am seeing, search for the text "Why Is A Survey Done". The first occurrence is a within-document jump-to link, which should jump to a header below it. If the script execution to generate a document outline is disabled, the jump works. But if the script is executed and the document outline generated, the jump-to link does not work.

View 2 Replies View Related

JQuery :: Perform / Execute So And So, When Anchor Element 'clicked'?

Jul 29, 2010

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 ..

[code]....

View 4 Replies View Related

Using Anchor Jumps With 'instant' Anchor Based Navigation?

Sep 4, 2011

Having a little bit of trouble with a site I'm currently working on I'm using some AJAX for the instant g-mail/facebook style navigation, you know the kind, with no refreshes, etc. Problem is, to allow for back/forward and bookmarks, I currently use a URL that looks like:[URL].. This is fine, not a problem... The issue comes into play when I want to open up the news.html page, from my home.html page, and have it open to news item #6 (for example).

I can't add a #, because one is already being used to reference the anchor for the content div. Has anyone run into a similar problem before? If so, how did you resolve it? Can some jQuery be used to find the location of the news item div in question, on load, and scroll to it like that?

View 8 Replies View Related

Document.location.reload(false) Fails To Go To #anchor

Aug 5, 2011

Code:
<a name="loc"></a>
<a href="#loc" onClick="document.location.href='#loc'
document.location.reload(false);return false">Click here to go to your location</a>

When you click onto the link you should go to the page location marked by the anchor tag "loc", however, upon clicking you go to the top of the page and never redirected to the exact spot where your anchor tag is located. Why is that? I'm using IE6 (per requirement) as my platform.

View 9 Replies View Related

JQuery :: Target A "Cycle #anchor" From An External Page Link?

Sep 3, 2010

I have Cycle "pager" navigation working flawlessly in one of my pages. What i'm trying to do is this:

I'm Attempting to LINK to specific Anchors from a link on a different page.

Example:
// external page link //
<a href="http://www.convertstyle.com/beta/apparel/womens-apparel#shirt1">Headline Womens</a>

[Code]....

View 1 Replies View Related

OnClick="function Value Of The Anchor Tag Just Clicked?

Oct 23, 2010

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.

View 1 Replies View Related

Jquery :: Fancybox - Clicking On Anchor Link

Jun 10, 2011

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.

Here's my code:
Code:
<script type='text/javascript'> window.onload = function()
{ setTimeout(function()
{ document.getElementById('popupLink').click();
}, $timeleft); }; </script>

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.

View 3 Replies View Related

HTML - Displaying A Hidden Slider When <Anchor> Is Clicked

Nov 2, 2009

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...........

View 1 Replies View Related

OnClick="function - Whats The Value Of The Anchor Tag Just Clicked

Oct 23, 2010

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.

View 3 Replies View Related

JQuery :: Toggleclass On A Link, With The Href Of The Current Anchor?

Mar 7, 2010

What am i doing wrong? I'm trying to toggleclass on a link, with the href of the current anchor

var anchor=window.location.hash;
$('#nav a[href='.anchor.']').toggleClass('active');

View 1 Replies View Related

JQuery :: Anchor Link List Show / Hide Content ID On Mouseover

Jun 8, 2011

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.

Here's my HTML
<!--client list-->
<ul id="clientList">
<li>no quote Client /</li>
<li><a href="#client1">Client 1</a> /</li>
<li>no quote Client /</li>
<li><a href="#client2">Client 2</a> /</li>
</ul>
<!--client testimonials--> .....

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;
} .....

View 2 Replies View Related

Pass Link To Anchor?

Aug 9, 2010

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 ?

Code:
<a class="buy" href="javascript:link()" target="_blank">buy</a>

View 4 Replies View Related

Catch #anchor Link OnLoad?

Aug 31, 2010

What I want is for jQuery to do something when the page has loaded depending on the anchor in the URL.

For example:

domain.com/index.html#dothis
domain.com/index.html#dothat
domain.com/index.html#dosomethingelse

Do these come under the onLoad event or something else?

View 1 Replies View Related

Anchor Link In New Window Loads Parent

Jul 23, 2005

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....

View 1 Replies View Related

Document Write Link Not Allowing IMG Anchor?

Sep 30, 2010

I am trying to figure out how to successfully place an image anchor in the following script ---

<script>document.write ("<a href="http://contact."+ domain +"/ws/eBayISAPI.dll?ShowCoreAskSellerQuestion&requested="+ userid +"&iid="+ itemid +"&frm=284&redirect=0&SSPageName=PageAskSellerQuestion_VI"><img src="http://www.thebluedot.net/images/layout/contact_us.gif" style="border:none;"></a>");</script>

[Code]...

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved