Jump to content


Photo

java script question


  • Please log in to reply
3 replies to this topic

#1 Svet

Svet

    Jr. Member

  • Members
  • PipPip
  • 14 posts
  • 3

Posted 22 April 2012 - 07:52 PM

I just cant understand why this does not work in processwire... It works great on local computer

$(function () {
  if ($(window).innerWidth() < 600) {
   $('#slider').anythingSlider({
	expand	   : false,
	showMultiple : false,
	changeBy	 : 1
   });
  }
  else {
   $('#slider').anythingSlider({
	expand	   : true,
	showMultiple : 2,
	changeBy	 : 1
   });
  }
});


#2 diogo

diogo

    Hero Member

  • Moderators
  • 2,068 posts
  • 1176

  • LocationPorto, Portugal

Posted 23 April 2012 - 04:59 AM

Javascript shouldn't work differently in Processwire. Check if you are including jQuery or if you have the #slider element on your template.

#3 Svet

Svet

    Jr. Member

  • Members
  • PipPip
  • 14 posts
  • 3

Posted 23 April 2012 - 08:48 AM

Of coarse... I must of been over tired last night... After replacing default jquery-1.4.2.min.js with jquery.min.js it works fine!
Wonder if all those versions of jQuery are different somehow.
Well, the site is on its way of being all sizes of screen friendly! :)

http://www.sebagokayakcompany.com

#4 diogo

diogo

    Hero Member

  • Moderators
  • 2,068 posts
  • 1176

  • LocationPorto, Portugal

Posted 23 April 2012 - 05:57 PM

Glad it worked :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users