Hi,
Its a bit generic question. In the following code:
//required for each plugin
$(document).ready(function() {
//plugin specific statements here
$('#block').corner();
})
if I want to specify a wild card in place of #block, e.g. any id starting with #block, is there any way to do that?
To be specific, i want all my blocks to be with round corner. But there is no common class or id among them. But all the blocks' ids do start with "block"
Comments
Comment #1
nevets commentedActually there is not id called 'block' but there all blocks have a class of 'block' so you could use
(# replaced with dot (.) which is used for classes). If you theme does not use block as a class for all blocks you can add it to the themes block.tpl.php file.
Comment #2
chandrabhan commentedThanks, I did that and it worked. Only issue being my page load has become exteremly slow (may be because of so many blocks). I might have to look at rounding of blocks and reserve javascript rounding for specific cases.
Comment #3
flickerfly commentedI'm having the same problem with slow loading, especially since I added a gradient to it. I'd be interested to hear how you solve that problem. You can see mine at http://members.fim.org
Comment #4
WorldFallz commented@nevets thanks for answering the question!
I tried clicking on the link above, but I get access denied.
re: performance-- it's on my list of things to do to create a couple of really ugly block heavy pages to test performance and see what, if anything, can be done to improve it. I haven't tried it yet, but i'm sure loading up all the effects and using them all on the same page can't be pretty.
Right now I only use these javascript effects in very targeted / specific ways and performance has been fine. I also make sure i minify any plugins that don't come already pre-minified (i haven't had the chance to check into d6's js aggregation yet and how efficient it is).
javascript effects are not really a good substitute for good graphics. If you find yourself using multiple effects on multiple elements, it's probably time to revisit the graphics for your theme.
also note, that blocks themselves can be pretty performance intensive on their own without any effects-- though d6 block level caching should ease that burden.
Comment #5
WorldFallz commented