Jump to content

[solved] jQuery slider plugin not using the value fetched from database


Recommended Posts

Hi,

I was doing a slider module . I have taken fancytransection as slider. In the slider as per documentation I am using all these values to show slider

 

effect: '', // wave, zipper, curtain
width: 500, // width of panel
height: 332, // height of panel
strips: 20, // number of strips
delay: 5000, // delay between images in ms
stripDelay: 50, // delay beetwen strips in ms
titleOpacity: 0.7, // opacity of title
titleSpeed: 1000, // speed of title appereance in ms
position: 'alternate', // top, bottom, alternate, curtain
direction: 'fountainAlternate', // left, right, alternate, random, fountain, fountainAlternate
navigation: false, // prev and next navigation buttons
links: false // show images as links

 

Here I am fetching the value of width,height and navigation from the database. So that one can manually set values for all this.

This is working for width and hight that I am getting from the database. But the value for navigation which I am getting either true or false from the database is not working. Everytime it is showing the slider navigation.

 

Here is the codes that have been used in my .tpl file

 

<script>
var result_navigation="{$result_navigation}";
var result_width="{$result_width}";
var result_height="{$result_height}";
$.fn.jqFancyTransitions.defaults = {  
  width: result_width, // width of panel
  height: result_height, // height of panel
  strips: 10, // number of strips
  delay: 5000, // delay between images in ms
  stripDelay: 50, // delay beetwen strips in ms
  titleOpacity: 0.7, // opacity of title
  titleSpeed: 1000, // speed of title appereance in ms
  position: 'alternate', // top, bottom, alternate, curtain
  direction: 'fountainAlternate', // left, right, alternate, random, fountain, fountainAlternate
  effect: '', // curtain, zipper, wave
  navigation: result_navigation, // prev next and buttons
  links : true // show images as links	
};
</script>

Here the value for width as result_width and height as result_height has been working fine. But the value for result_navigation is fetching fine with false or true value. But when I am using that in the code its not working. It is showing the navigation just like the value is true. value for false is not working here. Can someone kindly tell me how to solve this issue? Any help and suggestions will be really appreciable. Thanks

Link to comment
Share on other sites

so it's okay :/ i just thought that you use it as boolean.

 

i've got idea. check:

 

this is working code:

navigation: false, // prev and next navigation buttons

 

and this is yours:

var result_navigation="{$result_navigation}";
navigation: result_navigation, // prev next and buttons

 

you use navigation: "false" instead the navigation: false

maybe the value of navigation variable have to be a bool? (not string)

  • Like 1
Link to comment
Share on other sites

so it's okay :/ i just thought that you use it as boolean.

 

i've got idea. check:

 

this is working code:

navigation: false, // prev and next navigation buttons

 

and this is yours:

var result_navigation="{$result_navigation}";
navigation: result_navigation, // prev next and buttons

 

you use navigation: "false" instead the navigation: false

maybe the value of navigation variable have to be a bool? (not string)

 

@vekia thanks for the reply.. Yes I just made change to the codes and I used bool instead of varchar . Then in .tpl file I just used this

var result_navigation= {if $result_navigation == 1 }true{else}false{/if}; and used that variable inside the jQuery and it worked fine. Really thanks for the help... :)

Edited by module_developer (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...