Friday, August 31, 2012

Re: Javascript Image Hollover In Django

I don't think this is really related to Django?

Anyway, if the selectors '.slides', '.slideshow' don't match anything, this will not work. Try wrapping the image elements in a div with class "slideshow". See http://jquery.malsup.com/cycle/basic.html for inspiration (view source).


    Joni


perjantai, 31. elokuuta 2012 14.13.50 UTC+3 coded kid kirjoitti:
When a user place his mouse or click on any image thumbnails, I want
the particular thumbnail image to display in large size above the set
of thumbnails images on the same page in my django template. I tried
the below Javascript code but it's not working. I'm a noob in
javascript. If there's any way I can do it in jquery please let me
know.

  {% block content %}
      <script type="text/javascript">
      $(function() {
      $('.slideshow').hover(
        function() { $('.slides').cycle('resume'); },
        function() { $('.slides').cycle('pause'); }
     );

     $('.slides').cycle({
     fx:     'fade',
     speed:   .3,
     timeout: 280,
     next:   '#next',
     prev:   '#prev'
    }).cycle("pause");
    });
 </script>



 <p><center><a href="{{ MEDIA_URL }}/{{post.main_view}}"><img
src="{{post.thumbnail_1.url}}" width="83" height="78"></a>

  <a href="{{ MEDIA_URL }}/{{post.side_view}}"><img
src="{{post.thumbnail_2.url}}" width="83" height="78"> </a>


  <a href="{{ MEDIA_URL }}/{{post.sitting_view}}"><img
src="{{post.thumbnail_3.url}}" width="83" height="78"></a>

   <a href="{{ MEDIA_URL }}/{{post.rook_view}}"><img
src="{{post.thumbnail_4.url}}" width="83" height="78"></a>

   {% if Meekme.thumbnail_5 %} <a href="{{ MEDIA_URL }}/
{{post.rook_2_view}}"><img src="{{post.thumbnail_5.url}}" width="83"
height="78"></a>{% endif %}

   {% if Meekme.thumbnail_6 %}<a href="{{ MEDIA_URL }}/
{{post.rook_3_view}}"><img src="{{post.thumbnail_6.url}}" width="83"
height="78"></a>{% endif %}
    </center></p>

    {% endblock %}

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/NXjk4pIrPjIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment