function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bentonbenton 

jquery call function

I am trying to call my jquery function but I can not figure out how it works within VF Page. This code works fine on my website but within VF it does not behave.

I need to call my galleria function to load a theme (Styling) and to start a slideshow (run).

 

<script>
    
    var j$ = jQuery.noConflict();
    
    (document).ready(function($) {
      
    Galleria.loadTheme('galleria/themes/classic/galleria.classic.min.js');
    Galleria.run('#galleria');
    });
    </script>

 

Nothing is called. The styling does not change and my gallery is not displayed. Any ideas of what Im doing wrong?

Saurabh DhobleSaurabh Dhoble

(A) Make sure you have included the correct jquery files in your page :-

 

<apex:page >
    <apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></apex:includeScript>
    <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.base.css" />
    <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery.ui.theme.css" />    
   <script>

 

(B) Check the ID of the "galleria" container - I'm pretty sure the ID would have changed. Look at this post on how to reference objects in jquery.

 

http://www.iterativelogic.com/using-jquery-with-visualforce-pages/