[jQuery] Re: JSS - New Plug-in
On Oct 10, 12:17 am, hj [EMAIL PROTECTED] wrote: On Oct 9, 12:56 am, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \} \ [and more like that] I hope you're aware of a couple of issues with this method: I had typed from my memory. I think, in the original version, I didn't hard-code the selector here (used from bc_selectors or so) 1) The style element is not a legal descendant of body. Better to append it to the head. Since, it's only for the detection purpose, I think, this is good (IMHO). 2) The ECMAScript standard doesn't define the \ as a string continuation character. Better to simply concatenate string literals. I didn't know that actually. Thanks for proving me with very useful info. -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
[jQuery] Re: JSS - New Plug-in
On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \ } \ div[id=r_css]{\ height: 0px;\ } \ div#r_css:nth-child(1){\ position: fixed;\ } \ /style\ div id=r_css\ div id=r_cssc \ /div \ /div \ /div' ); var bc_selectors = { css1: 'div#r_css', css2: 'div[id=r_css]', css3: 'div#r_css:nth-child(1)' }; var bc = { css1: ($(bc_selectors.css1).css('width') == '0px'), css2: ($(bc_selectors.css2).css('height')=='0px'), css3: ($(bc_selectors.css3).css('position')=='fixed') }; $('div#r_csstest').remove(); console.log(bc); }); -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
[jQuery] Re: JSS - New Plug-in
Ok, I'm pleased to say I have updated the plugin and we are now at 0.3 This brings a whole bunch of tweaks but mainly it (hopefully) fixes the IE issues that people where having. Ta, Andy. On 9 Oct, 08:56, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \} \ div[id=r_css]{\ height: 0px;\} \ div#r_css:nth-child(1){\ position: fixed;\} \ /style\ div id=r_css\ div id=r_cssc \ /div \ /div \ /div' ); var bc_selectors = { css1: 'div#r_css', css2: 'div[id=r_css]', css3: 'div#r_css:nth-child(1)'}; var bc = { css1: ($(bc_selectors.css1).css('width') == '0px'), css2: ($(bc_selectors.css2).css('height')=='0px'), css3: ($(bc_selectors.css3).css('position')=='fixed')}; $('div#r_csstest').remove(); console.log(bc); }); -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
[jQuery] Re: JSS - New Plug-in
On Oct 9, 12:56 am, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: On Oct 8, 3:42 pm, Andy Kent [EMAIL PROTECTED] wrote: snip Yep, absolutely. If you have any ideas on how we could test a browsers support for a selector without maintaining a hard coded list then I would love to hear them. snip $(document).ready(function () { $('body').append( 'div id=r_csstest \ style type=text/css \ div#r_css{ \ width: 0px; \} \ [and more like that] I hope you're aware of a couple of issues with this method: 1) The style element is not a legal descendant of body. Better to append it to the head. 2) The ECMAScript standard doesn't define the \ as a string continuation character. Better to simply concatenate string literals.
[jQuery] Re: JSS - New Plug-in
I noticed that you have added String.prototype.trim. jQuery actually has this already, e.g. jQuery.trim( foo ); An easy was to get better CSS support in browsers that are not up to it. Maybe in a future version, browsers that are capable will just be ignored? Also, maybe best to wrap it in a closure: (function($) { // plugin code here, use $ as much as you like })(jQuery); On Oct 7, 12:39 am, Andy Kent [EMAIL PROTECTED] wrote: Hi Guys, This is a plug-in that was thrown together in a few spare hours after chatting with some people at FOWA last week, I hadn't had much sleep at the time so it's still a bit rough round the edges. In a nutshell though it gives you full support for all jQuery selectors from within your CSS files in a totally unobtrusive mannor. This effectively means cross browser CSS3 support via JavaScript. You can find out more and grab it from: http://andykent.bingodisk.com/bingo/public/jss/ Any feedback, good or bad would be appreciated. Thanks, Andy.
[jQuery] Re: JSS - New Plug-in
On Oct 7, 4:39 am, Andy Kent [EMAIL PROTECTED] wrote: snip http://andykent.bingodisk.com/bingo/public/jss/ I *exactly* wanted to do the same plugin. I also used similar idea in some of the projects already (crude code without plugin). My ideas were: 1. Common crossbrowser CSS in a file, say crossbrowser.css 2. CSS2 in css2.css. Not linked, but commented out (linking in non- compliant browser has side effects for the selectors. So, just commented) 3. CSS3 in css3.css. Not linked, but commented out Plugin: 1. If FF (more other detection for capability) a. link the css2.css via script b. Don't link css3.css, but hack the rules and fix them via $.css() [Parse the comments, find css3.css and get the content with $.ajax, parse the content and apply hacks) 2. If IE a. Don't link css2.css css3.css, but hack the rules and fix them via $.css() -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
[jQuery] Re: JSS - New Plug-in
WOW!
[jQuery] Re: JSS - New Plug-in
Sam Collett wrote: I noticed that you have added String.prototype.trim. jQuery actually has this already, e.g. jQuery.trim( foo ); Urg! No messing with core JS objects please - don't turn jQuery in to another Prototype :( @ All developers: Please, please, please namespace stuff properly. This is one of the biggest advantages of jQuery.
[jQuery] Re: JSS - New Plug-in
Very cool How would you recommend using it ? Ie. would you have a jss.css containing specific CSS included after the normal CSS ? Or is your intention to ignore users without javascript ? Jonah On Oct 7, 3:16 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: A question. Probably I do not get itbut how you could use it in real world? I mean what you think this should be helpfull. Looks quite interesting but I do not get it completely. Andrea On 6 oct, 18:51, Glen Lipka [EMAIL PROTECTED] wrote: This looks interesting. Would it fix this problem here?http://www.commadot.com/jquery/cssAND.php Glen On 10/6/07, Andy Kent [EMAIL PROTECTED] wrote: Hi Guys, This is a plug-in that was thrown together in a few spare hours after chatting with some people at FOWA last week, I hadn't had much sleep at the time so it's still a bit rough round the edges. In a nutshell though it gives you full support for all jQuery selectors from within your CSS files in a totally unobtrusive mannor. This effectively means cross browser CSS3 support via JavaScript. You can find out more and grab it from: http://andykent.bingodisk.com/bingo/public/jss/ Any feedback, good or bad would be appreciated. Thanks, Andy.
[jQuery] Re: JSS - New Plug-in
It would be good to see this detect and use Brandon Aaron's Live Query( http://brandonaaron.net/docs/livequery/ ) for new elements added after $.jss.apply() is called. Josh On Oct 6, 6:39 pm, Andy Kent [EMAIL PROTECTED] wrote: Hi Guys, This is a plug-in that was thrown together in a few spare hours after chatting with some people at FOWA last week, I hadn't had much sleep at the time so it's still a bit rough round the edges. In a nutshell though it gives you full support for all jQuery selectors from within your CSS files in a totally unobtrusive mannor. This effectively means cross browser CSS3 support via JavaScript. You can find out more and grab it from: http://andykent.bingodisk.com/bingo/public/jss/ Any feedback, good or bad would be appreciated. Thanks, Andy.
[jQuery] Re: JSS - New Plug-in
Yay! child selectors in ie! thank you :-)
[jQuery] Re: JSS - New Plug-in
It would be good to see this detect and use Brandon Aaron's Live Query(http://brandonaaron.net/docs/livequery/) for new elements added after $.jss.apply() is called. Yep, this is on the plan, but it actually involves a slightly different approach. Rather than using .css() to apply the styles I intend to add classes to matched elements and then write a new stylesheet to the document using these class names as hooks. In initial tests this is much faster allows for a more reliable cascade. Once this is in place adding Live Query support should be quite trivial. (Thanks go to John for the orginal suggestion). First things first though, let's get IE working! Watch this space...
[jQuery] Re: JSS - New Plug-in
Impressive work! Would this by chance make position:fixed for IE6 just work? That alone would be a god-send for me right now.
[jQuery] Re: JSS - New Plug-in
This looks interesting. Would it fix this problem here? http://www.commadot.com/jquery/cssAND.php Glen On 10/6/07, Andy Kent [EMAIL PROTECTED] wrote: Hi Guys, This is a plug-in that was thrown together in a few spare hours after chatting with some people at FOWA last week, I hadn't had much sleep at the time so it's still a bit rough round the edges. In a nutshell though it gives you full support for all jQuery selectors from within your CSS files in a totally unobtrusive mannor. This effectively means cross browser CSS3 support via JavaScript. You can find out more and grab it from: http://andykent.bingodisk.com/bingo/public/jss/ Any feedback, good or bad would be appreciated. Thanks, Andy.
[jQuery] Re: JSS - New Plug-in
A question. Probably I do not get itbut how you could use it in real world? I mean what you think this should be helpfull. Looks quite interesting but I do not get it completely. Andrea On 6 oct, 18:51, Glen Lipka [EMAIL PROTECTED] wrote: This looks interesting. Would it fix this problem here?http://www.commadot.com/jquery/cssAND.php Glen On 10/6/07, Andy Kent [EMAIL PROTECTED] wrote: Hi Guys, This is a plug-in that was thrown together in a few spare hours after chatting with some people at FOWA last week, I hadn't had much sleep at the time so it's still a bit rough round the edges. In a nutshell though it gives you full support for all jQuery selectors from within your CSS files in a totally unobtrusive mannor. This effectively means cross browser CSS3 support via JavaScript. You can find out more and grab it from: http://andykent.bingodisk.com/bingo/public/jss/ Any feedback, good or bad would be appreciated. Thanks, Andy.