First off, I apologize if this is too "noobie" a question or has been
answered somewhere else (I can't find it anywhere). I'm new to jQuery,
and I'm trying to learn some basics. Anyways, I'm stumped on the
following.
How can I convert this to jQuery?
var links = ...
> The ultimate goal would be to filter the selection so that only text
> enclosed in given classes (say loremipsum and third in my example) are
> returned.
First off, I'm also new to jQuery so I apologize if my solution is the
best way to do this. Anyways, here's what I came up with
$(docum
> No question is too "noobie". Welcome aboard! :-)
I appreciate the warm welcome = )
> That code won't work at all.
> I would suggest reading the doc page on .each():
Definitely on my to-do list...
> If you just want the loop index, it's passed to the .each() callback as the
> first parameter:
First off, I want to thank everyone for such quick replies.
> That will work, but it's a fairly brittle way to do things. If you add
> another link earlier in your page, it will change the loop indexes and
> you'll have to revise your code to match.
I understand and agree with you. I don't think
On Nov 30, 5:33 pm, René <[EMAIL PROTECTED]> wrote:
> Just wondering...
>
> When you have a link within a link:
No idea why you would do this...
> This is some long row of test and here is a
> and some more
> text
>
> ...how do you override the parent click event?
$(document).ready(fuction(){
I'm new to jQuery and I'm trying to learn some more about jQuery's
chaining feature. Chaining methods seems to be one of jQuery's best
features (at least this is how I see it described all over over the
web).
>From a developer standpoint, I can see it saving time as there is less
code to write; b
> > > One advantage to doing this
>
> > > $("#Results").html("Some Text").show();
>
> > > over this
>
> > > $("#Results").html("Some Text");
> > > $("#Results").show();
>
> > > would be that the script doesn't have to retrieve that wrapped set a
> > > second time
That's a good point. In this case
On Dec 3, 12:59 pm, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> That is half correct.
>
> Obj.method1().method2().method3()
>
> method1 return the modified original object, not a brand-new object.
>
> You could do this:
>
> var obj = $('#elementid');
> obj.method1();
> obj.method2();
> obj.meth
> When I run into this, I put my functions outside the doc.ready.block,
> but call them from within it. Then they can share vars.
Without any code, it's pretty hard to help troubleshoot issues...
But if I had to take a wild guess, I'd say it was a scoping issue.
The setTimeOut function excutes
> Even more than that, if you were to return $(this) you wouldn't be chaining
> on the original object.
>
> // Return the same object that this function was
> // called as a method of (i.e. the jQuery object).
> return this;
>
> // Return a *new* jQuery object that contains the
>
First off, I'm not sure this is even possible, but I thought I'd
ask...
Is it possible to use jQuery (or just plain JavaScript) to simulate a
link click?
Can something like this be done?
// Script
function doSomething()
{
// executes some code
}
$(document).ready(function()
{
$("#MyLink
How do you dynamically add or remove stylesheets to a page?
I've seen a lot of examples on how to add css styles or classes to an
elment, but I haven't found anything on adding/removing entire
stylesheets...
> Just bind doSomething() to the click event for the second link.
Can you expand on this? I apologize, I'm somewhat new to jQuery.
> This looks like a usability nightmare, but whatever ...
Looking at my example, I can see why you say this. Let me try to
explain what I'm trying to do.
I have a
> No need for scripting:
>
> #thumbnails li a { display: block; height: 200px; }
I think you are missing what I'm trying to do...
> $("#MyLink").click(function(){ $("#Link1").click(); return false; });
>
> You'll need to add the id to the first link.
Yeah, thats essentially what I want to do. N
> No offense meant, but I think you've misunderstood the CSS I posted.
> As I understand it, you want the entire LI to be clickable. The CSS
> rule I posted will do just that by causing the A to fill the LI. If
> the width is also an issue, then set that, as well.
>
> There's no need for the JQuer
I'm pretty new to jQuery and I get pretty lost when using the $this
variable. I've seen people use it in so many different ways-- ($this, $
(this), $.this, $.(this), etc-- to where I don't know which way is the
correct way to use it. Anyways, can somebody look at the following
code and tell me wha
> Here's a rundown on 'this'...
>
> this - is a JavaScript keyword. Inside a function that is called as a method
> of some object, this is a reference to the object in question. But whoever
> calls a function can explicitly set this to be any object. In the hover
> event handlers (and all jQuery e
I've been beating my head over this code for quite some time. I was
hoping somewhere here can send me on the right direction...
Here is my jQuery Code:
$(document).ready(function()
{
// Dynamically Configures the active link based on ID attribute in
body tag
var pageIndex = $("body").attr(
Alright, I'm really confused now. On my index page, the body tag has
an ID with a value of "Link0." On this page it works fine; only the
first link in the navigation section is changed.
Now on all the other pages where the body tag ID is another number
(i.e. Link1, Link2, etc), everything just fa
I ended up fixing the issue myself. For those that want to know, it
was type-casting issue. I change the following line:
>var pageIndex = $("body").attr("id");// Pulls ID value from body tag
>pageIndex = pageIndex.substring(4);
to
var pageIndex = $("body").attr("id");// Pulls I
> Where would the code that you've listed go?
jQuery is really designed to be separate from the HTML content; so
with that being said, it is typically found in the head section of the
document.
Now, you can't just put that in the head section and expect it to
work, because it will fire before th
> The initiation:
>
> $(document).ready(function(){
> $("ul#sf-menu-id").superfish({
> autoArrows: false,
> pathClass: 'current'
> }).find('ul').bgIframe();
>
> });
Try changing your document.ready statement to this:
$(document).ready(function()
> I'm using jquery to validate a form and that I'm using this link to to
> the submit:
>
> < a href="javascript:void(0);" onclick="document.form.submit();">
> Submit
This will not work because you are calling the submit method for the
form, not any validation script... Also, is there any reason
> I have a form with 3 inputs:
>
>
>
>
>
>
>
> Submit link
>
First off, why do you have an submit button and a submit link? Second,
what are you using to validate the form?
Is this what you are trying to do?
$(document).ready(function(){
// This is the border code
$("img, li.img-corner").hover(
function(){
$(this).next("li.event").css({borderBottom: "1px solid
#00"});
},
function(){
$(this).next("li.even
> No dice, I'm afraid. The only change was that it generated white, drop-
> down arrows again. Thank you for trying to help me out. I'm going to
> create a test environment later today, with the same settings and
> files, but without being embedded in one of my pages. I think bgIframe
> may have a
26 matches
Mail list logo