Yeah, Klaus. That space doesn't really exist in my code (though I don't think it matters... not to IE any way), it was just because I was typing it as quickly as I could. :o)

Cheers,
Chris

Klaus Hartl wrote:
Alex Cook schrieb:
Wait, I’m confused…

What does .newWindow relate too? The code you’re using has jQuery looking for A within .newWindow… Are you trying to find all the A tags with a class of newwindow? If so, the constructer would be $(“a.newWindow”). jQuery uses CSS syntax to target things, so if you’re unfamiliar with how to select an element with a class, I’d suggest doing some googling on it or read the jQuery.com pages on Expressions.

Second, you’ve constructed the click() function wrong… you don’t need the var handle = bit… function () { window.open(this.href, ‘some_target’, ‘width=550, height=550’); } is all you need.

-ALEX

------------------------------------------------------------------------

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Christopher Jordan
*Sent:* Friday, December 15, 2006 9:40 AM
*To:* jQuery Discussion.
*Subject:* [jQuery] I need syntax help, please.

This should be a quick one.

I know there's a way to do this, but it escapes me at this time.

I've got a few <a href...> tags on my screen, and I want some of them to open in the same window and some to open in a pop up, sized specifically.

Here's what I've got so far:

<script>
    $(document).ready(
    function (){$("a", ".newWindow").click(
        function(){
// there's more than just width and height, but you get the idea. var handle = window.open(this.href, 'some_target', 'width=550, height=500');
        });
    });
</script>


I've tried this same idea with the following changes:
   ... $("a", "#newWindow").click(...
and
   ... $("a", newWindow).click(...
and
   ... $("#newWindow", "a").click(...
and
   ... $(".newWindow", "a").click(...
and
   etc., etc., etc.

Where am I going wrong. So far in my jQuery experience, I've only had need to find elements by their class, element type, or ID. But not a combination of those. Can someone please hit me with the correct syntax? Hit me hard, so I don't forget it next time. :o)

Cheers,
Chris


And there shouldn't be a white space in the options string:
'width=550,height=500'


-- Klaus


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to