Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <div class="item-image">
  2. <div class="plus-wrapper">
  3. <div class="plus"></div>
  4. <img src="source_to_image" alt="">
  5. </div>
  6. </div>
  7.  
  8. var image = $('.plus-wrapper img');
  9. image.each(function () {
  10. var that = $(this);
  11. if (that.width() < 250) {
  12. that.next('.plus').css('right', '41px');
  13. }
  14. });
  15.  
  16. $(window).load(function(){
  17. var image = $('.plus-wrapper img');
  18. image.each(function () {
  19. var that = $(this);
  20. if (this.width < 250) {
  21. that.prev().css('right', '41px');
  22. }
  23. });
  24. });
  25.  
  26. var image = $('.plus-wrapper img');
  27. image.each(function () {
  28. if ($(this).width() < 250) {
  29. $(this).siblings('.plus').css({'right' : '41px'});
  30. }
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement