Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jul 2007
    Location
    Essex, United Kingdom
    Posts
    161
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Small Javascript issues with site

    Hi Guys,

    I am willing to pay (please private message me your charge)

    for the following errors to be resolved on the website:

    http://www.essexseos.co.uk/cefina2_wp/portfolio

    There are 2 problems first being that I need the code to randomise the order of the gallery everytime you view it on both the main page with all images and the refined subsequent pages (im sure this is simple but I don't have the time to debug this and someone with advanced javascript experience could do this in a much more timely manner than I can)

    The other problem is the following:

    on the portfolio page when you refine by 'kitchen' on the navigation then you refine by 'city homes' and click the first thumbnail on 'city homes' the kitchen image from the 'kitchen' refinement appears in the lightbox.

    Can anybody help me with this please let me know.

    Please private message me your rates and I will provide access to the site.

    Many Thanks

    James

  • #2
    New Coder
    Join Date
    Nov 2012
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello! We're interested here. I have emailed you on your msn mail. Kindly check.

    Herein my email sandramercado2010 [at] gmail [dot] com.

    I'll be looking forward to hear your response.

    -
    Thanks...
    Last edited by sandramercado; 11-28-2012 at 10:10 PM.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    You should be randomising the gallery on the server before delivering the web page. If the page is being generated from PHP then simply shuffle() the array the gallery images are in.

    If you have an array of the images in JavaScript that you want in random order then you can shuffle them easily as well if you add a shuffle method - http://javascriptexample.net/extobjects13.php
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    Regular Coder
    Join Date
    Jul 2007
    Location
    Essex, United Kingdom
    Posts
    161
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Hi Felgall,

    Would I add the array to this part of my code?

    PHP Code:
    <?php
    /**
    Plugin Name: Complete Gallery Manager for Wordpress
    Plugin URI: http://plugins.righthere.com/complete-gallery-manager/
    Description: Complete Gallery Manager for WordPress is an exquisite jQuery plugin for creating magical galleries. This is an incredible versatile plugin, which lets you create amazing looking galleries very easily. From simple fully responsive galleries or with infinite scroll, with this plugin it is very easy.
    Version: 1.0.2 rev25487
    Author: Rasmus R. Sorensen (RightHere LLC)
    Author URI: http://plugins.righthere.com
    **/

    include'options-panel/class.pop_post.php';
    define("CGM_VERSION",'1.0.2');

    define("COMPLETE_GALLERY_PATH"ABSPATH 'wp-content/plugins/' basename(dirname(__FILE__)).'/' ); 
    define("COMPLETE_GALLERY_URL"trailingsla****(get_option('siteurl')) . 'wp-content/plugins/' basename(dirname(__FILE__)) . '/' ); 

    global 
    $complete_gallery_display;
           
    $complete_gallery_display '';

    require_once 
    COMPLETE_GALLERY_PATH.'inc/isotope_generator.php';
    require_once(
    COMPLETE_GALLERY_PATH.'inc/install.php'); 

    class 
    complete_gallery_manager_plugin 
        var 
    $id 'cgm';
        var 
    $plugin_page
        var 
    $menu_name;
        var 
    $gallery_count_id 1;
        var 
    $gallery_script_load = array();
        var 
    $gallery_css_load = array();
        var 
    $short_code_name 'complete_gallery';

        function 
    complete_gallery_manager_plugin(){
            
    $this->menu_name __('CGM Settings','cgm');
            require_once(
    COMPLETE_GALLERY_PATH.'inc/isotope_settings.php');

            
    add_action("plugins_loaded", array(&$this,"plugins_loaded") );    
            
    add_action("admin_menu", array(&$this,"admin_menu") );
            
            if(
    is_admin()){
                require_once 
    COMPLETE_GALLERY_PATH.'options-panel/load.pop.php';
                
    rh_register_php('options-panel',COMPLETE_GALLERY_PATH.'options-panel/class.PluginOptionsPanelModule.php''2.0.2');
            }
        }
        
        function 
    admin_menu(){
            if(
    is_admin() && (current_user_can('manage_options') || current_user_can('cgm_create_gallery'))){         
                
    add_menu_page$this->menu_name
                               
    $this->menu_name
                               
    'edit_pages'
                               (
    $this->id.'-start'), 
                               array(&
    $this,'get_started_options'), 
                               
    COMPLETE_GALLERY_URL.'images/cgm.png' );
                               
                
    $this->plugin_page add_submenu_page(($this->id.'-start'),
                                                      
    __("Get Started",'cgm'), 
                                                      
    __("Get Started",'cgm'), 
                                                      
    'edit_pages',
                                                      (
    $this->id.'-start'), 
                                                      array(&
    $this,'get_started_options') );
                
                
                
    add_action'admin_head-'$this->plugin_page
                            array(&
    $this,'get_started_options_head') );
                            
                
    do_action(($this->id.'-options-menu'));
                
                
                if(
    current_user_can('manage_options') || current_user_can('cgm_insert_gallery')){             
                    require_once 
    COMPLETE_GALLERY_PATH.'admin/TinyMCE-extra-button.php';
                    new 
    cgm_tinymce_extra_button();
                }
            }
        }
        
        
        function 
    plugins_loaded(){
        
            
    $check_install get_option('cgm_version');
            if(
    $check_install CGM_VERSION){
                
    cgm_install_capabilities();
            } 
        
            
    $this->create_sub_menu();
            
    add_shortcode($this->short_code_name, array(&$this,'do_shortcode'));
        }    
        
        function 
    create_sub_menu(){     
            require_once 
    COMPLETE_GALLERY_PATH.'admin/admin_post_list.php';             
            new 
    cgm_admin_post_list($this->id);
            
            if(
    is_admin() && (current_user_can('edit_pages') || current_user_can('manage_options'))){

                
    $settings = array(
                    
    'id'                    => $this->id.'-opt',
                    
    'plugin_id'                => $this->id,
                    
    'menu_id'                => $this->id.'-opt',
                    
    'capability'            => 'manage_options',
                    
    'options_varname'        => 'cgm_options',
                    
    'page_title'            => __('Options','cgm'),
                    
    'menu_text'                => __('Options','cgm'),
                    
    'option_menu_parent'    => ($this->id.'-start'),
                    
    'options_panel_version'    => '2.0.3',
                    
    'notification'            => (object)array(
                        
    'plugin_version'=>  CGM_VERSION,
                        
    'plugin_code'     => 'CGM',
                        
    'message'        => __('Complete gallery manager update %s is available!','cgm').' <a href="%s">'.__('Please update now','cgm')
                    ),
                    
    'registration'         => true,
                    
    'theme'                    => false,
                    
    'import_export'          => false,
                    
    'import_export_options' => false
                    
    );    
                
                
    do_action('rh-php-commons');    
                
    //no longer loaded like this, instead the do_action takes care of loading the one from the rh plugin with the latest version of pop.
                //require_once COMPLETE_GALLERY_PATH.'options-panel/class.PluginOptionsPanelModule.php';    
                                 
                
    new PluginOptionsPanelModule($settings);
                 
                require_once 
    COMPLETE_GALLERY_PATH.'admin/option.panel.php';
                new 
    cgm_options($this->id);
                
                
            }
        }    
        
        
        function 
    do_shortcode($atts) {
            global 
    $complete_gallery_display;

            
    $post_id '';
            
            if(!empty(
    $atts['id'])){
                
    $post_id $atts['id'];
            }

            
            
    $return_content '';
            
            if(!empty(
    $post_id)){
            
                
    $cgm_flag get_post_meta($post_id"cgm_flag",true);    
                
    $cgm_settings get_post_meta($post_id"cgm_settings",true);
            
                
    $cgm_width  get_post_meta($post_id"cgm_width",true);    
                
    $cgm_height get_post_meta($post_id"cgm_height",true);    


                
    $return_content .= '<div id="completegallery'.$this->gallery_count_id.'" ';
                
    $return_content .='style="overflow:auto;';
                
                if(!empty(
    $atts['style'])){
                    
    $return_content .= $atts['style'];
                }
                
                if(!empty(
    $cgm_width) and $cgm_width 0){
                    
    $return_content .= ' width:'.$cgm_width.'px ';
                }
                
                if(!empty(
    $cgm_height) and $cgm_height 0){
                    
    $return_content .= ' height:'.$cgm_height.'px ';
                }
                                        
                
    $return_content .='"class="completegallery ';
                if(!empty(
    $atts['class'])){
                    
    $return_content .= $atts['class'].' ';
                }
                
    $return_content .='"';
                
                
    $return_content .= '>';
                
    $return_content .= '<div class="loading">Loading Gallery</div>';
                if(!empty(
    $cgm_flag)) {        
                       foreach(
    $complete_gallery_display[$cgm_flag]['class_js'] as $tmp_js_key =>  $tmp_js ){ 
                        if(empty(
    $this->gallery_script_load[$tmp_js_key])){
                               if(empty(
    $tmp_js)){
                                   
    wp_enqueue_script$tmp_js_key ); 
                               } else {
                                   if(
    substr($tmp_js_key01) == '*'){
                                       
    $return_content .= '<script src="'.$tmp_js.'" type="text/javascript"></script>';
                                   } else {
                                    
    wp_register_script$tmp_js_key$tmp_js, array(), '1.0',false);
                                    
    wp_enqueue_script$tmp_js_key ); 
                                }
                               }
                               
    $this->gallery_script_load[$tmp_js_key] = true;
                           }
                       }
                           
                       foreach(
    $complete_gallery_display[$cgm_flag]['class_css'] as $tmp_css_key =>  $tmp_css ){ 
                        if(empty(
    $this->gallery_css_load[$tmp_css_key])){
                            
    wp_register_style$tmp_css_key$tmp_css);
                            
    wp_enqueue_style$tmp_css_key ); 
                            
    $this->gallery_css_load[$tmp_css_key] = true;        
                        }    
                      }
                
                    if(!empty(
    $cgm_settings) and !empty($cgm_flag) and !empty($this->gallery_count_id) ){
                        if(!empty(
    $complete_gallery_display[$cgm_flag]['call_js_func'])){
                        
                            
    $return_content .= '<script>';
                            
    $return_content .= 'function cgm_atload'.($this->gallery_count_id).'(){';
                            
    $return_content .= $complete_gallery_display[$cgm_flag]['call_js_func'].'('.$this->gallery_count_id.',\''.$cgm_settings.'\','.$post_id.',\''.COMPLETE_GALLERY_URL.'\');';
                            
    $return_content .=        'if(typeof (window.cgm_atload'.($this->gallery_count_id+1).') == \'function\') {';
                            
    $return_content .=            'cgm_atload'.($this->gallery_count_id+1).'();';
                            
    $return_content .=        '}';
                            
    $return_content .=    '}</script>';
                        }
                    }
                }
            }
            
            
    $return_content .= '</div>';
            
    $return_content .= '<div class="clear" style="clear:both;"></div>';
            if(
    $this->gallery_count_id == 1){
                
    $return_content .= '<script>window.onload=cgm_atload;';
                
    $return_content .=    'function cgm_atload(){';
                
    $return_content .=        'if(typeof (window.cgm_atload1) == \'function\') {';
                
    $return_content .=            'cgm_atload1();';
                
    $return_content .=        '}';
                
    $return_content .=    '}</script>';
            }
        
        
            
    $this->gallery_count_id += 1;
            
    //echo $return_content;
             
    return $return_content;
        }
        
        function 
    globalt_shorcode_generator($array_datas){
            
    $return_content '['.$this->short_code_name.' ';
            
            if(!empty(
    $array_datas)){
                foreach(
    $array_datas as $key => $array_data){
                    
    $return_content .= $key '="'.$array_data.'" ';            
                }
            }
            
            
    $return_content .= ']';
            
            return 
    $return_content;
        }
        
        
        function 
    get_started_options_head(){
             
    wp_register_style'cgm_get_started'COMPLETE_GALLERY_URL.'css/get_started.css');
            
    wp_enqueue_style'cgm_get_started');
        }     
        
        function 
    get_started_options(){
            include_once(
    COMPLETE_GALLERY_PATH.'admin/getstarted.php');
        }
        
        function 
    cgm_get_image_scalse(){
            global 
    $_wp_additional_image_sizes;
            
            
    $image_sizes '';
            
            
    $image_sizes['thumbnail']['width'] = get_option('thumbnail_size_h');
            
    $image_sizes['thumbnail']['height'] = get_option('thumbnail_size_w');
            
    $image_sizes['thumbnail']['crop'] = get_option('thumbnail_crop');  
            
            
    $image_sizes['medium']['width'] = get_option('medium_size_h');
            
    $image_sizes['medium']['height'] = get_option('medium_size_w');
            
    $image_sizes['medium']['crop'] = get_option('medium_crop');     
            
            
    $image_sizes['large']['width'] = get_option('large_size_h');
            
    $image_sizes['large']['height'] = get_option('large_size_w');
            
    $image_sizes['large']['crop'] = get_option('large_crop');     
                
            if(!empty(
    $_wp_additional_image_sizes)){
                
    $image_sizes array_merge($image_sizes,$_wp_additional_image_sizes);
            }     
            
            return 
    $image_sizes;
        }    
    }
    $complete_gallery_manager_plugin = new complete_gallery_manager_plugin();

  • #5
    Regular Coder
    Join Date
    Jul 2007
    Location
    Essex, United Kingdom
    Posts
    161
    Thanks
    9
    Thanked 0 Times in 0 Posts
    The Javascript code I think is associated with it.

    Code:
    function cgm_drawIsoTope_gallery(tmp_id,tmp_settings,tmp_post_id,tmp_COMPLETE_GALLERY_URL,debug){
    
        if(debug){
            cgm_drawIsoTope_gallery_v2(tmp_id,tmp_settings,tmp_post_id,tmp_COMPLETE_GALLERY_URL);
        } else {
            jQuery(document).ready(function($){
                var _url = tmp_COMPLETE_GALLERY_URL+'frames/frame.get_data.php';    
                jQuery.post(_url,{gallery_count_id:tmp_id,post_id:tmp_post_id},function(data){
                    if(data.R == 'OK'){
                        jQuery('#completegallery'+tmp_id).html(data.RETURN_DATA);
                        cgm_drawIsoTope_gallery_v2(tmp_id,tmp_settings,tmp_post_id,tmp_COMPLETE_GALLERY_URL);
                    }
                },'json');
            });
        }
    
    
    }
    
    
    function cgm_drawIsoTope_gallery_v2(tmp_id,tmp_settings,tmp_post_id,tmp_COMPLETE_GALLERY_URL){
        jQuery(document).ready(function($){
            if(typeof(tmp_settings)=='string'){
                tmp_settings = JSON.parse(decodeURI(tmp_settings));
    
                if(tmp_settings.cgm_mouseEventClick == 'prettyPhoto'){
                
                    var cgm_tmp_pretty_photo = new Object();
                    
                    if(typeof(tmp_settings.cgm_pretty.theme)=='string'){
                        cgm_tmp_pretty_photo.theme = tmp_settings.cgm_pretty.theme;
                    }
                    
                    if(typeof(tmp_settings.cgm_pretty.thumbnails) =='boolean' && tmp_settings.cgm_pretty.thumbnails == false){
                        cgm_tmp_pretty_photo.gallery_markup = ' ';
                    }
                    
                    if(typeof(tmp_settings.cgm_pretty.thumbnails) =='string' && tmp_settings.cgm_pretty.thumbnails == 'false'){
                        cgm_tmp_pretty_photo.gallery_markup = ' ';
                    }
    
                    cgm_tmp_pretty_photo.show_title = tmp_settings.cgm_pretty.showtitle;    
                    cgm_tmp_pretty_photo.autoplay_slideshow = tmp_settings.cgm_pretty.autoplayslideshow;
                    cgm_tmp_pretty_photo.deeplinking = tmp_settings.cgm_pretty.deeplinking;            
                
                    if(typeof(tmp_settings.cgm_pretty.opacity)=='number'){
                        cgm_tmp_pretty_photo.opacity = tmp_settings.cgm_pretty.opacity;
                    }    
                
                    if(typeof(tmp_settings.cgm_pretty.slideshow)=='number'){
                        cgm_tmp_pretty_photo.slideshow = tmp_settings.cgm_pretty.slideshow;
                    }
                    
                    if(typeof(tmp_settings.cgm_pretty.animationspeed)=='string'){
                        cgm_tmp_pretty_photo.animation_speed = tmp_settings.cgm_pretty.animationspeed;
                    }    
    
                    jQuery("#cgm_isotype_bg_"+tmp_id+" a[rel^='prettyPhoto']").prettyPhoto(cgm_tmp_pretty_photo);
                }
    
                var cgm_tmp_isotope = new Object();
                
                cgm_tmp_isotope.itemSelector = '.cgm_items';
                cgm_tmp_isotope.layoutMode = tmp_settings.cgm_layout.default;
                cgm_tmp_isotope.sortBy = tmp_settings.cgm_sort.default;            
    
                cgm_tmp_isotope.getSortData = {
                            index : function( $elem ) {
                                return parseInt( $elem.find('.index').text());
                            },
                            title : function( $elem ) {
                                return $elem.find('.title').text();
                            },
                            desc : function( $elem ) {
                                return $elem.find('.desc').text();
                            },
                            tag : function( $elem ) {
                                return $elem.find('.tag').text();
                            },
                            imageSize : function ( $elem ) {
                                return parseFloat( $elem.find('.size').text());
                            }
                        };    
                        
                if(typeof(tmp_settings.cgm_animation.type)=='string'){
                    cgm_tmp_isotope.animationEngine = tmp_settings.cgm_animation.type;    
                }
    
                if(typeof(tmp_settings.cgm_animation.duration)=='number'){
                    cgm_tmp_isotope.animationOptions = {
                         duration: tmp_settings.cgm_animation.duration,
                         easing: tmp_settings.cgm_animation.easing,
                         queue: false
                       }
                }
                
                
                if(tmp_settings.cgm_layout.default == 'masonry' || tmp_settings.cgm_layout.default == 'masonryHorizontal' || tmp_settings.cgm_layout.default == 'cellsByRow' || tmp_settings.cgm_layout.default == 'cellsByColumn'){
                    var cgm_height = 0;
                    var cgm_width = 0;
                    var cgm_lr = 0;
                    var cgm_hb = 0;            
                    jQuery('#cgm_isotype_bg_'+tmp_id).find('.cgm_items').each(function(){
                    
                        var cgm_lr = parseInt(jQuery(this).css("padding-left"))+parseInt(jQuery(this).css("padding-right"));
                        var cgm_hb = parseInt(jQuery(this).css("padding-bottom"))+parseInt(jQuery(this).css("padding-top"));    
                    
                    
                        if(cgm_width < (jQuery(this).width()+cgm_lr)){
                            cgm_width = (jQuery(this).width()+cgm_lr);
                        }
                        
        
                        if(cgm_height < (jQuery(this).height()+cgm_hb)){
                            cgm_height = (jQuery(this).height()+cgm_hb);
                        }        
                    }); 
                    
                    
                    cgm_tmp_isotope.masonry = {columnWidth : 1};
                    cgm_tmp_isotope.masonryHorizontal = {rowHeight:1};
                    cgm_tmp_isotope.cellsByRow = {columnWidth : cgm_width,rowHeight : cgm_height};
                    cgm_tmp_isotope.cellsByColumn = {columnWidth : cgm_width,rowHeight : cgm_height};
                    
                }
    
                jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope); 
    
                jQuery('#cgm_isotype_bg_'+tmp_id).parent().fadeTo('normal',1); 
                if(typeof(tmp_settings.cgm_universallScroll.loadNumber)=='number' && tmp_settings.cgm_universallScroll.loadNumber>0 && tmp_settings.cgm_universallScroll.loadNumber != null){
                    
                    var cgm_setscollepos = jQuery('#cgm_isotype_bg_'+tmp_id).parent();
                    if(typeof(tmp_settings.cgm_height) == 'undefined'  || (typeof(tmp_settings.cgm_height) == 'number' && tmp_settings.cgm_height == 0)){
                         cgm_setscollepos = jQuery(window);
                    } else {
                        jQuery(cgm_setscollepos).scrollTop(0);
                    }
                    
                    jQuery(cgm_setscollepos).scroll(function () {
                    
                    var cgm_universal_scroll_max = 0;
                    
                    if(typeof(tmp_settings.cgm_height) == 'undefined' || (typeof(tmp_settings.cgm_height) == 'number' && tmp_settings.cgm_height == 0)){
                        var cgm_top_universal =  jQuery('#cgm_isotype_bg_'+tmp_id).parent().offset();
                        cgm_top_universal = Math.round(cgm_top_universal.top);
                        cgm_universal_scroll_max = jQuery('#cgm_isotype_bg_'+tmp_id).parent().height() + cgm_top_universal - jQuery(this).height()+100;
                    } else {
                        cgm_universal_scroll_max = jQuery(this)[0].scrollHeight - jQuery(this).height();
                    }
                    
                        var tmp_universal = jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll span').html();
    
                        if(jQuery(this).scrollTop() > cgm_universal_scroll_max-50 && tmp_universal == 'true'){
                            jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll span').html('false');
    
                            jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll div').html('Loading');
                            jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll').fadeIn(500, function() {
    
                                jQuery.post(tmp_COMPLETE_GALLERY_URL+'frames/select_next_images.php',{'steps':tmp_settings.cgm_universallScroll.loadNumber,'post_id':tmp_post_id,count:(jQuery('#cgm_isotype_bg_'+tmp_id).children("div").length-1),'tmp_id':tmp_id},function(data){
                                    if(data.R == 'OK'){
                                        jQuery('#cgm_isotype_bg_'+tmp_id).isotope( 'insert', jQuery(data.DATA) );
                                        jQuery("#cgm_isotype_bg_"+tmp_id+" a[rel^='prettyPhoto']").prettyPhoto(cgm_tmp_pretty_photo);
                                    }
                                        
                                    jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll').fadeOut(500, function() {
                                        if(data.DATA == ''){
                                            jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll div').html('No more pictures');
                                            jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll').fadeIn(500, function() {    
                                                jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll').delay(1000).fadeOut(500, function() {
                                                    jQuery(this).hide();
                                                });    
                                            })    
                                        } else {
                                            setTimeout(function(){
                                                jQuery('#cgm_isotype_bg_'+tmp_id + ' .universall_scroll span').html('true');
                                            }, 500 );
                                        }
                                    });
                                },'json');
                            })
                        }
                    });
                }
            }    
                
        });
    }
    
    
    function cgm_sort_order_system(tmp_id,tmp_action,tmp_this){
        var cgm_tmp_isotope = new Object();
    
        cgm_tmp_isotope.sortAscending = tmp_action;
        
        jQuery(document).ready(function($){
            jQuery('#cgm_isotype_menu_'+tmp_id+' .cgm_sort_order a').removeClass('selected');
            jQuery(tmp_this).addClass('selected');
        
            jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
        });    
        
    }
    
    function cgm_sort_system(tmp_id,tmp_action,tmp_this){
        var cgm_tmp_isotope = new Object();
    
        cgm_tmp_isotope.sortBy = tmp_action;
        
        jQuery(document).ready(function($){
            jQuery('#cgm_isotype_menu_'+tmp_id+' .cgm_sort a').removeClass('selected');
            jQuery(tmp_this).addClass('selected');
        
            jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
        });    
        
    }
    
    function cgm_filter_system(tmp_id,tmp_action,tmp_this){
        var cgm_tmp_isotope = new Object();
        if(tmp_action != '*' && tmp_action != ''){
            tmp_action = '.'+tmp_action
        }
        cgm_tmp_isotope.filter = tmp_action;
        
        jQuery(document).ready(function($){
            jQuery('#cgm_isotype_menu_'+tmp_id+' .cgm_filter a').removeClass('selected');
            jQuery(tmp_this).addClass('selected');
        
            jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
        });    
        
        setTimeout(function(){
            jQuery('#cgm_isotype_bg_'+tmp_id+' .cgm_items').each(function(){
                if(jQuery(this).css('opacity') != 0){
                    jQuery(this).find('a').attr('rel','prettyPhoto[pp_gal]');
                } else {
                    jQuery(this).find('a').attr('rel','');
                }
            })
        },1000);
    }
    
    function cgm_changeImages(tmp_id,tmp_this,tmp_action){
        jQuery(document).ready(function($){
            var defaultdiv = jQuery(tmp_this).children('.default_image').html();
            var lastdiv = jQuery(tmp_this).children('.imageSize div:last').index()-1;
            var current = jQuery(tmp_this).children('.imageSize').find('.current').index();
            var newselect = 0;
            jQuery('#cgm_isotype_bg_'+tmp_id).isotope()
            jQuery(tmp_this).children('.imageSize').children('div:eq('+current+')').removeClass('current');
    
            if(tmp_action == 'exAll'){
                if(current == lastdiv){
                    newselect = 0;
                } else {
                    newselect = current + 1;
                    if(current > 1){
                        newselect = lastdiv;
                    }
                }
            } else if(tmp_action == 'ex0'){
                if(current == defaultdiv){
                    newselect = 0;
                } else {
                    newselect = defaultdiv;
                }
            } else if(tmp_action == 'ex1'){
                if(current == defaultdiv){
                    newselect = 1;
                } else {
                    newselect = defaultdiv;
                }
            } else if(tmp_action == 'ex2'){
                if(current == defaultdiv){
                    newselect = 2;
                } else {
                    newselect = defaultdiv;
                }
            } else if(tmp_action == 'ex3'){
                if(current == defaultdiv){
                    newselect = lastdiv;
                } else {
                    newselect = defaultdiv;
                }
            }
            
            jQuery(tmp_this).children('.imageSize').children('div:eq('+newselect+')').addClass('current');    
            
            var newHeight = jQuery(tmp_this).children('.imageSize').children('div:eq('+newselect+')').find('.height').html();
            var newWidth = jQuery(tmp_this).children('.imageSize').children('div:eq('+newselect+')').find('.width').html();        
            var newUrl = jQuery(tmp_this).children('.imageSize').children('div:eq('+newselect+')').find('.url').html();     
    
            if(jQuery(tmp_this).parent().attr('id') == 'cgm_items'){
                //jQuery(tmp_this).parent().width(newWidth).height(newHeight);
                jQuery(tmp_this).parent().css({ width: newWidth,height:newHeight });
    
            } else if(jQuery(tmp_this).parent().parent().attr('id') =='cgm_items'){
                //jQuery(tmp_this).parent().parent().width(newWidth).height(newHeight);
                jQuery(tmp_this).parent().parent().css({ width: newWidth,height:newHeight });
            }    
            
            
            jQuery(tmp_this).children('.size').text(parseFloat(newWidth*newHeight));
    
            jQuery(tmp_this).children('img').attr('src',newUrl).css({ width: newWidth,height:newHeight });
        
            if(jQuery(tmp_this).parent().attr('id') == 'cgm_items'){
                jQuery('#cgm_isotype_bg_'+tmp_id).isotope('updateSortData',jQuery(tmp_this).parent());
            } else if(jQuery(tmp_this).parent().parent().attr('id') =='cgm_items'){
                jQuery('#cgm_isotype_bg_'+tmp_id).isotope('updateSortData',jQuery(tmp_this).parent().parent());
            }    
            
            var cgm_tmp_isotope = new Object();
            var cgm_height = 0;
            var cgm_width = 0;
            var cgm_lr = 0;
            var cgm_hb = 0;            
            jQuery('#cgm_isotype_bg_'+tmp_id).find('.cgm_items').each(function(){
                var cgm_lr = parseInt(jQuery(this).css("padding-left"))+parseInt(jQuery(this).css("padding-right"));
                var cgm_hb = parseInt(jQuery(this).css("padding-bottom"))+parseInt(jQuery(this).css("padding-top"));    
                
                if(cgm_width < (jQuery(this).width()+cgm_lr)){
                    cgm_width = (jQuery(this).width()+cgm_lr);
                }
                        
        
                if(cgm_height < (jQuery(this).height()+cgm_hb)){
                    cgm_height = (jQuery(this).height()+cgm_hb);
                }        
            }); 
    
            cgm_tmp_isotope.masonry = {columnWidth : 1};
            cgm_tmp_isotope.masonryHorizontal = {rowHeight:1};
            cgm_tmp_isotope.cellsByRow = {columnWidth : cgm_width,rowHeight : cgm_height};
            cgm_tmp_isotope.cellsByColumn = {columnWidth : cgm_width,rowHeight : cgm_height};
                    
                    jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
                setTimeout(function(){
                    jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
                }, 100 )
    
            setTimeout(function(){
                    jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
                }, 500 )
    
            setTimeout(function(){
                    jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
                }, 1000 )
    
            setTimeout(function(){
                    jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
                }, 1500 )
        });
    }
    
    
    
    
    function cgm_layout_system(tmp_id,tmp_action,tmp_width,tmp_height,tmp_this){
        var cgm_tmp_isotope = new Object();
        cgm_tmp_isotope.layoutMode = tmp_action;
    
        jQuery(document).ready(function($){
            var last_Str = jQuery('#cgm_isotype_menu_'+tmp_id+' .cgm_layout .selected').attr('title');
            var last_bool = false;
            var current_bool = false;
            if(last_Str== 'straightAcross' || last_Str== 'masonryHorizontal' || last_Str== 'cellsByColumn' || last_Str== 'fitColumns'){
                last_bool = true;
            }
    
            if(tmp_action== 'straightAcross' || tmp_action== 'masonryHorizontal' || tmp_action== 'cellsByColumn' || tmp_action== 'fitColumns'){
                current_bool = true;
            }    
            
            if(tmp_height == '100%'){
                tmp_height = '80%';
            }
    
            if(tmp_action == 'masonry' || tmp_action == 'masonryHorizontal' || tmp_action == 'cellsByRow' || tmp_action == 'cellsByColumn'){
                var cgm_height = 0;
                var cgm_width = 0;
                var cgm_lr = 0;
                var cgm_hb = 0;            
                jQuery('#cgm_isotype_bg_'+tmp_id).find('.cgm_items').each(function(){
                
                    var cgm_lr = parseInt(jQuery(this).css("padding-left"))+parseInt(jQuery(this).css("padding-right"));
                    var cgm_hb = parseInt(jQuery(this).css("padding-bottom"))+parseInt(jQuery(this).css("padding-top"));    
                
                    if(cgm_width < (jQuery(this).width()+cgm_lr)){
                        cgm_width = (jQuery(this).width()+cgm_lr);
                    }
    
                    if(cgm_height < (jQuery(this).height()+cgm_hb)){
                        cgm_height = (jQuery(this).height()+cgm_hb);
                    }        
                }); 
                
                cgm_tmp_isotope.masonry = {columnWidth : 1};
                cgm_tmp_isotope.masonryHorizontal = {rowHeight:1};
                cgm_tmp_isotope.cellsByRow = {columnWidth : cgm_width,rowHeight : cgm_height};
                cgm_tmp_isotope.cellsByColumn = {columnWidth : cgm_width,rowHeight : cgm_height};
                
            }
                
                
            jQuery('#cgm_isotype_menu_'+tmp_id+' .cgm_layout a').removeClass('selected');
            jQuery(tmp_this).addClass('selected');
                
            if (last_bool !== current_bool) {
    
                    var style = current_bool ? { height: '80%', width: jQuery('#cgm_isotype_bg_'+tmp_id).width() } : { width: 'auto',height:'auto'};
                jQuery('#cgm_isotype_bg_'+tmp_id).addClass('no-transition').css( style );
                
                setTimeout(function(){
                    jQuery('#cgm_isotype_bg_'+tmp_id).removeClass('no-transition').isotope( cgm_tmp_isotope );
                }, 100 )
                
            } else {
                jQuery('#cgm_isotype_bg_'+tmp_id).isotope(cgm_tmp_isotope);
            }
        });    
                
         
    }

  • #6
    New Coder
    Join Date
    Oct 2012
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear Partner,

    I would surely provide you assistance for yor requirement feel free mail me ram.kumar(at)optisolbusiness.com

    We have 70+ working in Optisol Business Solution

    We have excellent portfolio and references in USA. We can give client references on request.

    I look forward to hearing from you..

    Regards
    Ram
    Skype-ramkumar80560


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •