I just know this is a dumb question with a simple answer, but here goes...
I have something like:
a href=#div1 class=triggerLink a/a
a href=#div2 class=triggerLink a/a
and
div id=div1/div
div id=div2/div
I need to match the link to it's div, but can't figure out the selector. Non
working test
almost too simple!
$(this.hash)
On 2/15/07, Tim Baxter [EMAIL PROTECTED] wrote:
I just know this is a dumb question with a simple answer, but here goes...
I have something like:
a href=#div1 class=triggerLink a/a
a href=#div2 class=triggerLink a/a
and
div id=div1/div
div id=div2/div
I
I'm not following. I tried
targetDiv = $(this.hash);
but still didn't get the element.
On 2/15/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
almost too simple!
$(this.hash)
On 2/15/07, Tim Baxter [EMAIL PROTECTED] wrote:
I just know this is a dumb question with a simple answer, but here
goes...
I have
You are thinking too complicated this should do:
$(document).ready(function() {
$(a.trigger).click(function(){
$(this.hash).css({background: red });
});
});
Regards
[EMAIL PROTECTED] wrote:
I just know this is a dumb question
$(this.hash) gives you a jquery object that you can use for anything you want!
before you use it alert(this.hash) to show you exactly what you have.
I've used it before.. I thought it was cute that the # in the name is
the same as the # in the id name!
On 2/15/07, Tim Baxter [EMAIL
Tim Baxter schrieb:
But that's not what I need. I need to match up the div to the link. I'm
going to be manipulating it in several ways, not always onclick, but the
relationship between the two is the important part. Actually, the whole
red thing is just for testing.
So far, I haven't
Thanks.. it just took a while to see how it fits.
On 2/15/07, Klaus Hartl [EMAIL PROTECTED] wrote:
Tim Baxter schrieb:
But that's not what I need. I need to match up the div to the link. I'm
going to be manipulating it in several ways, not always onclick, but the
relationship between the
$(document).ready(function() {
$(a.trigger).click(function(){
$(this.hash).css({background: red })
// right here the chain can keep on chaining
and no local or (GLOBAL) variables!
});
});
On 2/15/07, Klaus Hartl
Ⓙⓐⓚⓔ schrieb:
$(document).ready(function() {
$(a.trigger).click(function(){
$(this.hash).css({background: red })
// right here the chain can keep on chaining
and no local or (GLOBAL) variables!
});
});
Yes,
I'm looking at the HTML specs
(http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#edef-A)
and hash doesn't look like a standard attribute. It seems to work for me in
both IE and FF, but if it's not in the standard, your browser may not
support it. You may be stuck with using the
On 2/15/07, Aaron Heimlich [EMAIL PROTECTED] wrote:
On 2/15/07, Danny Wachsstock [EMAIL PROTECTED] wrote:
I'm looking at the HTML specs
(http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#edef-A
)
and hash doesn't look like a standard attribute.
That's because it's not an
On 2/15/07, Danny Wachsstock [EMAIL PROTECTED] wrote:
I'm looking at the HTML specs
(http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#edef-A)
and hash doesn't look like a standard attribute.
That's because it's not an attribute, it's a property of the HTML DOM object
for a
Mozilla agrees with Aaron..
http://developer.mozilla.org/en/docs/DOM:window.location
Properties
All of the following properties are strings. You can read them to get
information about the current URL or set them to navigate to another
URL.
The Example column contains the values of the
oops. It should be
$(/#.+$/.exec(this.href)[0]);
Danny
Danny Wachsstock wrote:
I'm looking at the HTML specs
(http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#edef-A)
and hash doesn't look like a standard attribute. It seems to work for me
in both IE and FF, but if it's
On 2/15/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
Mozilla agrees with Aaron..
http://developer.mozilla.org/en/docs/DOM:window.location
That's talking about the window.location object. I was talking about the DOM
element for a's (HTMLAnchorElement). There appears to be no official
standard that
Guys, they're just anchor links:
http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#anchors-with-id
On 2/15/07, Ⓙⓐⓚⓔ [EMAIL PROTECTED] wrote:
Mozilla agrees with Aaron..
http://developer.mozilla.org/en/docs/DOM:window.location
Properties
All of the following properties are
On 2/15/07, Klaus Hartl [EMAIL PROTECTED] wrote:
This property is DOM Level 0, which is implemented by literally any
browser (from Netscape 2 onwards by all browsers,
http://www.quirksmode.org/js/dom0.html), just like document.forms and
these things.
So that explains it, then. Thanks, Klaus!
17 matches
Mail list logo