Advertisement
Guest User

Untitled

a guest
Sep 30th, 2017
980
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. var images = [
  2.  
  3. {
  4. src: 'cherish gallery/thumbs/tn_Akeira BETSEY COUTURE BRIDE.jpg',
  5. srcBig: 'cherish gallery/images/Akeira BETSEY COUTURE BRIDE.jpg',
  6. title: 'Akeira',
  7. longDescription: '<b><h1>Akeira</h1></b><br><b>Betsey Couture<br><br><h2>Sizes Available:</h2><br> 6 - 32.<b><br><b><br><b><b><b><H2>Colours Available:</h2><b><br>Various<br>Please Enquire Below<br><br><br><br><a href="mailto:cherishbridal@yahoo.co.uk?subject=Web Enquiry Regarding Romantica Charmaine Bridal Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>'
  8. },
  9.  
  10. {
  11. src: 'romanticabride/thumbs/tn_Charmaine.jpg',
  12. srcBig: 'romanticabride/images/Charmaine.jpg',
  13. title: 'Charmaine',
  14. longDescription: '<b><h1>Charmaine</h1></b><br><b>Romantica Of Devon <br><br><h2>Sizes Available:</h2><br> 6 - 32.<b><br><b><br><b><b><b><H2>Colours Available:</h2><b><br>Various<br>Please Enquire Below<br><br><br><br><a href="mailto:cherishbridal@yahoo.co.uk?subject=Web Enquiry Regarding Romantica Charmaine Bridal Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>'
  15. },
  16.  
  17.  
  18.  
  19. {
  20. src: 'cherish gallery/thumbs/Willow_thumbnail.jpg',
  21. srcBig: 'cherish gallery/images/Willow_preview.jpg',
  22. title: 'Snowdrop',
  23. longDescription: '<b><h1>Willow</h1></b><br><b>Opulence<br><br><b><H2>Colours Available:</h2><b><br>IVORY/SILVER, WHITE SILVER<br>Please Enquire Below<br><br><br><br><a href="mailto:cherishbridal@yahoo.co.uk?subject=Web Enquiry Regarding Opulence Willow Gown"class="enquiry rose glow" >Click To Enquire About This Item </a>'
  24. }
  25. ]
  26.  
  27. $(function(){
  28. var container = $('#thumbsContainer');
  29. $.each(images, function(index, value) {
  30. var image = $('<img>')
  31. .attr('src', value.src)
  32. .attr('title', value.title)
  33. .attr('alt', value.srcBig);
  34.  
  35.  
  36. container.append(image);
  37. });
  38. });
  39.  
  40. $('#thumbsContainer img').live('click', function(e) {
  41. var index = $('#thumbsContainer img').index(this);
  42. showDressInfo(index);
  43. });
  44.  
  45. function showDressInfo(index) {
  46. var value = images[index].longDescription;
  47. $('#dressinfo').html(value);
  48. }
  49.  
  50.  
  51. $(function(){showDressInfo(0);});
  52.  
  53. <HERE IS HOW I AM DOING THE THUMBNAIL ONE.. AS THIS JUST SHOWS WHICHEVER IS CLICKED..
  54. I NEED TO DO soMETHING SIMILAR FOR clicking cusorLeft and cursorRight. So I assume it either can index the images and then display the relevant longDescription. or do some kind of -1 / +1 thingn
  55.  
  56. THE BEHAVIOUR OF THE CURSORS ARE AS FOLLOWS :
  57.  
  58. $('#displayed').live('mousemove',function(e){
  59. var $this = $(this);
  60. var imageWidth = parseFloat($this.css('width'),20);
  61.  
  62. var x = e.pageX - $this.offset().left;
  63. if(x<(imageWidth/3))
  64. $this.addClass('cursorLeft').removeClass('cursorPlus cursorRight cursorMinus');
  65. else if(x>(2*(imageWidth/3)))
  66. $this.addClass('cursorRight').removeClass('cursorPlus cursorLeft cursorMinus');
  67. else{
  68. if(mode=='expanded'){
  69. $this.addClass('').removeClass('cursorLeft cursorRight cursorPlus');
  70. }
  71. else if(mode=='small'){
  72. $this.addClass('').removeClass('cursorLeft cursorRight cursorMinus');
  73. }
  74. }
  75. }).live('click',function(){
  76. var $this = $(this);
  77. if(mode=='expanded' && $this.is('.cursorMinus')){
  78. mode='small';
  79. $this.addClass('cursorPlus').removeClass('cursorLeft cursorRight cursorMinus');
  80. $('#thumbsWrapper').stop().animate({'bottom':'0px'},300);
  81. resize($this,1);
  82. }
  83. else if(mode=='small' && $this.is('.cursorPlus')){
  84. mode='expanded';
  85. $this.addClass('cursorMinus').removeClass('cursorLeft cursorRight cursorPlus');
  86. $('#thumbsWrapper').stop().animate({'bottom':'-85px'},300);
  87. resize($this,1);
  88. }
  89. else if($this.is('.cursorRight')){
  90.  
  91. var $thumb = $('#thumbsContainer img:nth-child('+parseInt(current+1)+')');
  92. if($thumb.length){
  93. ++current;
  94. loadPhoto($thumb,'cursorRight');
  95. }
  96. }
  97. else if($this.is('.cursorLeft')){
  98. var $thumb = $('#thumbsContainer img:nth-child('+parseInt(current-1)+')');
  99. if($thumb.length){
  100. --current;
  101. loadPhoto($thumb,'cursorLeft');
  102. }
  103. }
  104. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement