Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Zmiana parametru w locie w pluginie jQuery
universalStudio
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 13.11.2014

Ostrzeżenie: (0%)
-----


Witam
mam przykladowy plugin jQuery:
  1. jQuery('#pagepiling').pagepiling({
  2. direction: directionType,
  3. scrollingSpeed: 700,
  4. normalScrollElements: '.normal-scroll'
  5. });

i chciałbym juz po zaladowaniu tego skryptu zmienic parametr w tym pluginie - coś w tym stylu:

  1. jQuery("body").click(function(){
  2. jQuery('#pagepiling').pagepiling.normalScrollElements='';
  3. });
Oczywiście to nie działa...

normalScrollElements: '.normal-scroll' - chcialbym wyczyścić ten parametr, tak zeby funkcja go nie przetwarzała już.
Czy żeby to zrobić, musze na nowo załadować funkcje/plugin ze zmienionym parametrem czy moge to na szybko zrobic, bez przeladowania calej funkcji a jedynie nadpisanie tego parametru? Jeśli da sie tak zrobić jak to się robi?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
universalStudio
post
Post #2





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 13.11.2014

Ostrzeżenie: (0%)
-----


to jest poczatek zrodla wtyczki:

  1. /* ===========================================================
  2.  * pagepiling.js 0.0.8 (Beta)
  3.  *
  4.  * <a href="https://github.com/alvarotrigo/pagePiling.js" target="_blank">https://github.com/alvarotrigo/pagePiling.js</a>
  5.  * MIT licensed
  6.  *
  7.  * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
  8.  *
  9.  * ========================================================== */
  10.  
  11. (function ($) {
  12. $.fn.pagepiling = function (options) {
  13. var container = $(this);
  14. var lastScrolledDestiny;
  15. var lastAnimation = 0;
  16. var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));
  17. var touchStartY = touchStartX = touchEndY = touchEndX = 0;
  18.  
  19. //Defines the delay to take place before being able to scroll to the next section
  20. //BE CAREFUL! Not recommened to change it under 400 for a good behavior in laptops and
  21. //Apple devices (laptops, mouses...)
  22. var scrollDelay = 600;
  23.  
  24. // Create some defaults, extending them with any options that were provided
  25. options = $.extend({
  26. direction: 'vertical',
  27. menu: null,
  28. verticalCentered: true,
  29. sectionsColor: [],
  30. anchors: [],
  31. scrollingSpeed: 700,
  32. easing: 'swing',
  33. loopBottom: false,
  34. loopTop: false,
  35. css3: true,
  36. navigation: {
  37. 'textColor': '#000',
  38. 'bulletsColor': '#000',
  39. 'position': 'right',
  40. 'tooltips': ['section1', 'section2', 'section3', 'section4']
  41. },
  42. normalScrollElements: null,
  43. normalScrollElementTouchThreshold: 5,
  44. touchSensitivity: 5,
  45. keyboardScrolling: true,
  46. sectionSelector: '.section',
  47. animateAnchor: false,
  48.  
  49. //events
  50. afterLoad: null,
  51. onLeave: null,
  52. afterRender: null
  53. }, options);
  54. [...]

jest tam object options wiec dziwne ze nie lapie...

Cytat
Nie wiem czy nie ma błędu logicznego w Twojej potrzebie modyfikacji.

co masz na mysli? Zle podejscie?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 9.10.2025 - 08:30