Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • jacostander Friend
    #173974

    I’m using JA content slider to display images from a subfolder. When I click on these images in the slider, it opens up in the same window (larger version).

    I would like to know if there might be a possibility to open the image in a light box if clicked on please.

    Thank you in advance.

    Sherlock Friend
    #438787

    Hi jacostander,

    you can modify as follow steps to get the image open in a box when it’s clicked instead of open it in the same window
    1) open the file of modulesmod_jacontentsliderhelper.php you look for this line of code
    [PHP] $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image”>’ . $image . ‘</a>’;[/PHP]
    change it to
    [PHP] $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image modal” rel=”{handler: ‘image’, size: {x: 800, y: 500}}” >’ . $image . ‘</a>’;[/PHP]

    2) open the file modulesmod_jacontentslidermod_jacontentslider.php you would see this line of code
    [PHP] $mainframe = & JFactory::getApplication(); [/PHP]

    replace it by
    [PHP]
    $mainframe = & JFactory::getApplication();
    JHtml::_(‘behavior.modal’, ‘a.modal’);
    [/PHP]
    3) open the js file modulesmod_jacontentsliderassetsjsja_contentslider.js
    look for this function

    loadImage: function(el) {
    var holder = el.getElement(“.ja-image”);
    if(holder){
    var image = holder.getProperty(‘rel’);
    if(image != ” && image != null) {
    holder.setHTML(image);
    holder.setProperty(‘rel’, ”)
    }
    }
    },

    change it to
    loadImage: function(el) {
    var holder = el.getElement(“.ja-image”);
    if(holder){
    var image = holder.getProperty(‘rel’);
    if(image != ” && image != null) {

    }
    }
    },
    and look for this

    //Update element i
    update: function (text, ind){
    divobj = new Element(‘DIV’, {‘id’:’jsslide_’ + ind, ‘class’:’jsslide’});
    divobj.innerHTML = text;
    divobj.setStyle (‘position’,’absolute’);
    divobj.setStyle (‘z-index’,1);
    divobj.setStyle(‘width’, this.options.w);
    divobj.setStyle(‘height’, this.options.h);
    divobj.inject (this.options.wrapper);
    this.hide(divobj);
    this.elements = divobj;
    },

    change it to

    //Update element i
    update: function (text, ind){
    divobj = new Element(‘DIV’, {‘id’:’jsslide_’ + ind, ‘class’:’jsslide’});
    divobj.innerHTML = text;
    divobj.setStyle (‘position’,’absolute’);
    divobj.setStyle (‘z-index’,1);
    divobj.setStyle(‘width’, this.options.w);
    divobj.setStyle(‘height’, this.options.h);
    divobj.inject (this.options.wrapper);
    this.hide(divobj);
    modal = divobj.getElements(“a.modal”);
    SqueezeBox.assign(modal, {
    parse: ‘rel’
    });
    this.elements = divobj;
    },

    jacostander Friend
    #438833

    Hi,

    Thank you so much for your assistance, will try this. Thank you!

    UPDATE:

    Works 100% Thank you very much!

    jacostander Friend
    #438835

    I do have another question, I have 2 content sliders, and one with data from images the other from content.

    When I click on the image displayed from content, a light box open and display “an error has accrued”

    Any ideas how to ix this or to disable the click on the image please?

    Sherlock Friend
    #438957

    <em>@jacostander 301295 wrote:</em><blockquote>I do have another question, I have 2 content sliders, and one with data from images the other from content.

    When I click on the image displayed from content, a light box open and display “an error has accrued”

    Any ideas how to ix this or to disable the click on the image please?</blockquote>

    You can try as following to allow lightbox only if data from image
    open the file of modulesmod_jacontentsliderhelper.php you replace this line
    [PHP] $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image modal” rel=”{handler: ‘image’, size: {x: 800, y: 500}}” >’ . $image . ‘</a>’;[/PHP]

    by this block of code
    [PHP] $source = $params->get( ‘source’, ‘content’ );
    if($source == ‘image’){
    $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image modal” rel=”{handler: ‘image’, size: {x: 800, y: 500}}” >’ . $image . ‘</a>’;
    }else{
    $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image”>’ . $image . ‘</a>’;
    } [/PHP]

    I think that should help !

    gduran144 Friend
    #440418

    Hi I was using your solution on my site and was having the same problem with having two content sliders. Your original solution worked great, however when I used the second code the lightbox stopped working for the image content slider. Could you perhaps revist the code above and see what might be wrong?

    UPDATE: I just solved this issue. The if($source == ‘image’) statement in the above code was never evaluated to true because the image is in a folder. I changed the if statement to read as follows and it works perfectly. if($source==’folder’

    Sherlock Friend
    #440487

    Hi gduran144,

    Are you choosing the data from image source (Not from article content ) ? if that I think it’s strange if the lightbox no longer work for you, you can pm your url, the admin and ftp account i will take a look at it for you.

    jacostander Friend
    #440836

    My next Question, how can I do the same for the Joomla 1.5 version please?

    melator Friend
    #442847

    i Want make a link in the image. its possible? for example:

    Image 1 – Image 2 – Image 3
    when put the image send to a other website… you understand? sorry my poor English…

    Markus Friend
    #507083

    <em>@Sherlock Holmes 301217 wrote:</em><blockquote>Hi jacostander,

    you can modify as follow steps to get the image open in a box when it’s clicked instead of open it in the same window
    1) open the file of modulesmod_jacontentsliderhelper.php you look for this line of code
    [PHP] $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image”>’ . $image . ‘</a>’;[/PHP]
    change it to
    [PHP] $image = ‘<a href=”‘ . $link . ‘” title=”” class=”ja-image modal” rel=”{handler: ‘image’, size: {x: 800, y: 500}}” >’ . $image . ‘</a>’;[/PHP]

    2) open the file modulesmod_jacontentslidermod_jacontentslider.php you would see this line of code
    [PHP] $mainframe = & JFactory::getApplication(); [/PHP]

    replace it by
    [PHP]
    $mainframe = & JFactory::getApplication();
    JHtml::_(‘behavior.modal’, ‘a.modal’);
    [/PHP]
    3) open the js file modulesmod_jacontentsliderassetsjsja_contentslider.js
    look for this function

    loadImage: function(el) {
    var holder = el.getElement(“.ja-image”);
    if(holder){
    var image = holder.getProperty(‘rel’);
    if(image != ” && image != null) {
    holder.setHTML(image);
    holder.setProperty(‘rel’, ”)
    }
    }
    },

    change it to
    loadImage: function(el) {
    var holder = el.getElement(“.ja-image”);
    if(holder){
    var image = holder.getProperty(‘rel’);
    if(image != ” && image != null) {

    }
    }
    },
    and look for this

    //Update element i
    update: function (text, ind){
    divobj = new Element(‘DIV’, {‘id’:’jsslide_’ + ind, ‘class’:’jsslide’});
    divobj.innerHTML = text;
    divobj.setStyle (‘position’,’absolute’);
    divobj.setStyle (‘z-index’,1);
    divobj.setStyle(‘width’, this.options.w);
    divobj.setStyle(‘height’, this.options.h);
    divobj.inject (this.options.wrapper);
    this.hide(divobj);
    this.elements = divobj;
    },

    change it to

    //Update element i
    update: function (text, ind){
    divobj = new Element(‘DIV’, {‘id’:’jsslide_’ + ind, ‘class’:’jsslide’});
    divobj.innerHTML = text;
    divobj.setStyle (‘position’,’absolute’);
    divobj.setStyle (‘z-index’,1);
    divobj.setStyle(‘width’, this.options.w);
    divobj.setStyle(‘height’, this.options.h);
    divobj.inject (this.options.wrapper);
    this.hide(divobj);
    modal = divobj.getElements(“a.modal”);
    SqueezeBox.assign(modal, {
    parse: ‘rel’
    });
    this.elements = divobj;
    },</blockquote>

    Hi all ,

    did anyone try this with a Kranos 3.1.1?
    I have it kind of working but its still bugged …

    This part i couldnt find in the version 3.1.1

    2) open the file modulesmod_jacontentslidermod_jacontentslider.ph p you would see this line of code
    PHP Code:

    $mainframe = & JFactory::getApplication();


    replace it by
    PHP Code:


    $mainframe = & JFactory::getApplication();
    JHtml::_('behavior.modal', 'a.modal');

    Anyone has an Idea how to get this working on version 3.1.1 ?

    Thank you in advance

    Saguaros Moderator
    #507620

    Did you get it solved?

    Markus Friend
    #507633

    <em>@Saguaros 391849 wrote:</em><blockquote>Did you get it solved?</blockquote>

    No i didnt.

    Did you ?

Viewing 12 posts - 1 through 12 (of 12 total)

This topic contains 12 replies, has 6 voices, and was last updated by  Markus 10 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum