Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8490591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:10:16+00:00 2026-06-10T22:10:16+00:00

I have a problem using jQuery and prettyPhoto (plugin for wordpress)! My problem is

  • 0

I have a problem using jQuery and prettyPhoto (plugin for wordpress)! My problem is that i want to get image description from a hidden div, outside the already working a tag. This is what i have so far:

<div class="portfolie_short_content_containe">                  
    <a class="lightbox" style="text-decoration: none;" rel="lightbox" href="<?php echo $image[0]; ?>" title="<?php echo $image_desc; ?>">
        <span class="hover">
            <div class="portfolio_thump_hover_text">
                <span class="lable"><?php echo $short_descr;?></span><br>
                <span class="lable"><?php echo $link;?></span><br>
                <span class="lable"><FONT style="color : #f47b42;">Se CV</FONT></span>
            </div>
        </span>
        <img src="<?php echo $image[0]; ?>" width="<?php echo $image[1]; ?>" alt="<?php echo $image_alt; ?>"></img>
    </a>

    <!-- hidden div containing description -->
    <div id="lightbox" style="display: none"><p><?php echo $full_descr; ?></p><div>
</div>

And the jQuery.prettyphoto.js file looks like this!

theRel = $(this).attr('rel');
galleryRegExp = /\[(?:.*)\]/;
isSet = (galleryRegExp.exec(theRel)) ? true : false;
var x = 500;
var elmtid = $(this).attr('class');

// Put the SRCs, TITLEs, ALTs into an array.
pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i) {
    if ($(n).attr('rel').indexOf(theRel) != -1) 
        return $(n).attr('href'); 
}) : $.makeArray($(this).attr('href'));

pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i) { 
    if ($(n).attr('rel').indexOf(theRel) != -1) 
        return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : "";
}) : $.makeArray($(this).find('img').attr('alt'));

//Get text from hidden dir!     
pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i) {
    if ($(n).attr('rel').indexOf(theRel) != -1) 
        return ($(n).find('p').text()) ? $(n).find('p').text() : ""; 
}) : $.makeArray($(this).find('p').text());

I’m not that experienced in jQuery. Can anyone help to get hold of the description? I have tried something like this!

pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i) {
    if($(n).attr('class') != -1) 
        return ($('#'+elmtid).html()) ? $('#'+elmtid).html()  : \"\"; 
}) : $.makeArray($('#'+elmtid).html());

But it didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:10:18+00:00Added an answer on June 10, 2026 at 10:10 pm

    Solved it, maybe easy but first time working jQuery!

    <script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(document).ready(function(){
    
    //reference the class instead of a tag
    $j("div[class^='portfolie_short_content_containe']").prettyPhoto({theme: '<?php echo $portfolio_options["prtfl_prettyPhoto_style"]; ?>'});
    });
    </script>
    

    IN the js file i changed this.

    theRel = $(this).find('a').attr('rel');
    //theRel = $(this).attr('rel');
    galleryRegExp = /\[(?:.*)\]/;
    isSet = (galleryRegExp.exec(theRel)) ? true : false;
    var x=500;
    
    pp_images = $.makeArray($(this).find('a').attr('href'));
    pp_titles = $.makeArray($(this).find('img').attr('alt'));
    pp_descriptions =  $.makeArray($(this).find('p').html());
    

    It is not perfect but it works hope it helps other people with same issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem to get the utf-8 string from PHP using jQuery $.load()
I have a problem , i'm using jQuery plugin from http://www.stilbuero.de/jquery/tabs/ , plugin for
I have a problem with selecting not first selector using attributeContains jQuery('div[id*=abc]:not(:first)').hide();
im using fullcalendar jquery plugin in my web. i have a problem in which
I have a JQuery (using JQuery 1.4.2) problem that exhibits only in IE8 in
I have a problem I am using jquery U.I tabs that load everything with
I have this problem, I load a page using JQuery ajax, now within that
I have been using jQuery prettyPhoto plugin to show inline html content. This content
I have a problem using fadeIn() on div that contains elements which positions are
i have the following problem using jquery. I have sth like this <div id=yxz

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.