Guest User

Untitled

a guest
Jun 18th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. $('#btnSort').on("click",
  2. function () {
  3. $("#sortorder").css({
  4. 'position': 'absolute',
  5. 'z-index': '99',
  6. 'left': $(this).offset().right,
  7. 'top': $(this).offset().top + $(this).height() + 5
  8. }).slideToggle().delay(1000);
  9. });
  10.  
  11. var width = $(window).width();
  12. $.fn.positionFunction = function () {
  13. if (width < 500) {
  14. $("#styleList").css({
  15. 'position': 'absolute',
  16. 'z-index': '99',
  17. 'left': $(this).offset().right,
  18. 'top': $(this).offset().top + $(this).height() + 5
  19. }).slideToggle(1000);
  20.  
  21. } else {
  22. $("#styleList").css({
  23. 'position': 'absolute',
  24. 'z-index': '99',
  25. 'left': $(this).offset().left, <----------Error
  26. 'top': $(this).offset().top + $(this).height() + 5
  27. }).slideToggle(1000);
  28. }
  29. }
  30.  
  31. $('#btnStyle').on("click", function() {
  32. $.fn.positionFunction();
  33. });
Add Comment
Please, Sign In to add comment