$( function()  {
   $(div[class=hide-BAT$].hide();
});

I haven't tested this, but it should work. If not, verify the selector.

Not sure why you are giving a unique classname to all these elements. If you
need it, why not use the I'd attribute?

Regards,
Joe

On Nov 11, 2009 8:17 AM, "David pr" <davidpric...@gmail.com> wrote:

Hello,

Could you help me please. I have a list of hotel which I .hide
and .show div's to show more or less info.

so i have

<div class="Hide-BAT1 ... >

to

<div class="Hide-Bat55 … >

when the user press a button I use the code
var Hcode = $(this).attr("custom");
 $('div.Hide-' + Hcode).toggle();

but when the page loads how do I hide this div automatically ?

I have used

for (i = 0; i <= 70; i++)
{
  $("div.Hide-BAT" + i).hide();
}

But its slow and probably not the best way to do it ?

Hope you can help and this makes sense.

Regards

David

Reply via email to