You could add a data-* attribute to each pair of divs to identify the
specific div that needs to be toggled:
<div class="one" data-id="{{=i}}">Click to read more</div>
<div class="two" data-id="{{=i}}">
{{=LOAD('default', 'thread.load', args=[threads[i].id, threads[i].name],
client_side=True)}}
</div>
<script>
jQuery(document).ready(function(){
jQuery('.one').click(function() {
var id = $(this).data('id');
jQuery('.two[data-id="' + id + '"]').slideToggle()
});
});
</script>
Or you could wrap both divs in a parent div, give that div an id, and then
use that to identify the div to be toggled.
Anthony
On Thursday, June 23, 2016 at 12:03:15 PM UTC-4, Ron Chatterjee wrote:
>
> Funny, you said it that way. That was the problem. I forgot to take the
> layout off. It works fine now. Since you are so good at it.... lol. one
> problem I still have. When I toggle the link, if I have the thread in a
> loop. All the links open up. How to modify that javascript so only the
> request.args(0), I am requesting fold open that div element and every other
> one remain close. I explained that in a picture (attached).
>
>
>
>
>
>
>
>
>
> On Thursday, June 23, 2016 at 11:30:34 AM UTC-4, Anthony wrote:
>>
>> On Thursday, June 23, 2016 at 11:00:42 AM UTC-4, Ron Chatterjee wrote:
>>>
>>> If you look at my code though, I am not calling the LOAD inside the
>>> jquery (like you are saying calling LOAD from javascript). I am calling
>>> LOAD outside. All the jquery does it fold or fold back that div element. So
>>> why component?
>>>
>>
>> You said you wanted to call LOAD from jQuery.
>>
>> Anyway, hard to say what the problem is without seeing the code. Make
>> sure your .load view doesn't extend the layout.
>>
>> Anthony
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.