Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. /*This is one of the thumbnails that i have*/
  2. scrollbox li:nth-child(29){
  3. background-image: url("http://i.imgur.com/snDhpHO.jpg");
  4. background-position: center;
  5. background-size: auto 100%;
  6. background-repeat: no-repeat;
  7. }
  8. /*This is the container where the image is "sent" to*/
  9. /*Also, the transition for Firefox is not appearing correctly, better said, it doesn't transition at all, See it in Chrome/Opera and then compare to Firefox. If i could get some help on this issue as well it would be very helpful*/
  10. viewer{
  11. border-bottom-left-radius: 10px;
  12. border-bottom-right-radius: 10px;
  13. transition: all .5s ease-in-out;
  14. -moz-transition: all .5s ease-in-out;
  15. -webkit-transition: all .5s ease-in-out;
  16. display: block;
  17. width: 600px;
  18. height: 450px;
  19. }
  20.  
  21. function getId(element_Id){
  22. var id = document.getElementById(element_Id);
  23. var div = document.getElementById("image");
  24. var img = window.getComputedStyle(id,null).getPropertyValue("background");
  25. /*ffxxx is for Firefox but works as well on IE*/
  26. var ffimg = document.defaultView.getComputedStyle(id,null).getPropertyValue("background-image");
  27. var ffpos = document.defaultView.getComputedStyle(id,null).getPropertyValue("background-position");
  28. var ffsize = document.defaultView.getComputedStyle(id,null).getPropertyValue("background-size");
  29. var ffrep = document.defaultView.getComputedStyle(id,null).getPropertyValue("background-repeat");
  30. if(navigator.userAgent.indexOf("Chrome") != -1 || navigator.userAgent.indexOf("Opera") != -1){
  31. div.style.background = img;
  32. }else if(navigator.userAgent.indexOf("Firefox") != -1 ){
  33. div.style.setProperty('background-image', ffimg);
  34. div.style.setProperty('background-position', ffpos);
  35. div.style.setProperty('background-size', ffsize);
  36. div.style.setProperty('background-repeat', ffrep);
  37. }else if(navigator.userAgent.indexOf("rv:11") != -1 ){
  38. div.style.setProperty('background-image', ffimg);
  39. div.style.setProperty('background-position', ffpos);
  40. div.style.setProperty('background-size', ffsize);
  41. div.style.setProperty('background-repeat', ffrep);
  42. }else{}
  43. }
  44.  
  45. <gallery>
  46. <scrollBox>
  47. <ul>
  48. <li onclick="getId(this.id)" id="29"></li>
  49. </ul>
  50. </scrollBox>
  51. <viewer id="image">
  52. <zoom onclick="viewFull()">
  53. <div id="container">
  54. <img id="fullView" src="http://i.imgur.com/IH6vOT2.png" />
  55. <h3 id="zoom">Full View</h3>
  56. </div>
  57. </zoom>
  58. </viewer>
  59. </gallery>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement