Thanks Brian.
ok let me explain in brief what i am trying to do

in html
{% for name in eventname %}
   <div id="basicModal" class="viewalldetailslinktext">
        <div class="eventname"><a href='#' class='basic'>{{ name.title }}</
a></div>
   </div>
   <div id="basicModalContent"class="viewdetails">
       <div  style="color:red">{{ name.title }}</div>
       <div class="eventaddress">{{ name.address }}</div>
   </div>
{% endfor %}
//here to fore i was trying to generate div id using <div id={{ name }}
> which was generating in weired way "The" spice="" tate-le=""
jardin="" so i keep id as it is and i changed in my js file

$(document).ready(function ()
 {
        $(".viewalldetailslinktext ").find("a.basic,input.basic").click
(function (e)
        {
                e.preventDefault();
                $('#basicModalContent').modal();
        });
});

here i am passing class name "the ids will not help you because they
can have different values but all of the elements that you want to
lightbox have the same class"

so its working fine and for both div lightbox is coming.
but the problem again arise
in html i get two title

The Spice Tate-Le Jardin--> as link
The Spice Tate-Le Jardin Bangalore

Underground Monday at Maya--> as link
Underground Monday at Maya, Bangalore

first time i click on Spice Tate-Le Jardin then i shows me the
information related to that objects and second time when i click on
Underground Monday at Maya then it shows me the information related to
Undergrund objects. i seems to be so happy that its working. but when
i refresh page and i clicked on Underground Monday at Maya rather
first time than The Spice then i was getting the information related
to The Spice object not for Underground. so i am now worred if i use
uniqued div id and use this method and i do not know whether i will
get same problem or not and if i do not get same problem then how may
i generate unique id in well format like div1,div2,..... if i write in
loop and write div+i then my object display 2 times more.

I hope now you would have got me.


On Feb 6, 11:08 am, brian <bally.z...@gmail.com> wrote:
> On Thu, Feb 5, 2009 at 11:45 PM, Praveen <praveen.python.pl...@gmail.com> 
> wrote:
>
> > so that's why i am generating different div id
>
> > {% for name in eventname %}
> >                        <div id={{ name }} class="viewalldetailslinktext">
> > ...
>
> > so now my div id is
> > <div id="The" spice="" tate-le="" jardin=""
> > class="viewalldetailslinktext">
>
> It appears that you first must fix how your application assigns the ID
> to the div.
>
> Once you've dealt with that, just assign another class (eg.
> YourClassName) to your 2 divs.
>
> $(document).ready(function ()
>  {
>        $('.YourClassName input.basic, .YourClassName
> a.basic').click(function (e)
>        {
>                e.preventDefault();
>                $(this).parents(.YourClassName).modal();
>        });
>
>
>
> });

Reply via email to