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

  • Home
  • SEARCH
  • 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 7079019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:37:10+00:00 2026-05-28T06:37:10+00:00

We have uplaod function on our site. And uploaded file, displays link which on

  • 0

We have uplaod function on our site. And uploaded file, displays link which on click user can see file they have uploaded in new window.

We also use divbox http://jquery.phpbasic.com/divbox

My code is this:

$("#uploader" + queueId).html("
 <div class='cancel'>
  <input class='button_cancel' name='removeFile' fileName='"
  +fileObj.name.replace("'", "%27")+"' type='button'>
   </div>
  <a class='lightbox' href='" + self.attr("path") 
   + fileObj.name.replace("'", "%27") + "'><span class='fileName'>"
+fileObj.name+"</span></a>");

For some reason when we click on the link, it still opens in new window and doesnt initiate the lightbox.

In my page i see this ( all normal )

<a class="lightbox" href="uploads/nutshell.png">
 <span class="fileName">nutshell.png</span>
</a>

Which should fire the lightbox.. Anything scream out at you in the js code I posted above ? I am wondering if its self.attr(“path”)

Here is what we have::::::

in the js for divbox we have

$('.lightbox').divbox({caption: false});

in the js for the uploader we have.

$("#uploader" + queueId).html("<div class='cancel'><input class='button_cancel' name='removeFile' fileName='"+fileObj.name.replace("'", "%27")+"' type='button'></div><a class='lightbox' href='" + self.attr("path") + fileObj.name.replace("'", "%27") + "'><span class='fileName'>"+fileObj.name+"</span></a>");
  • 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-05-28T06:37:11+00:00Added an answer on May 28, 2026 at 6:37 am

    Presumably you’re doing something like this:

    $('a.lightbox').divbox({ ... })
    

    before you add the <a> in question with:

    $("#uploader" + queueId).html("...");
    

    $('a.lightbox') only applies to elements that exist on the page when $('a.lightbox') is called, it won’t bind DivBox to elements that are added to the page later. You’ll have to bind DivBox to the new <a> that you added with something like this:

    $("#uploader" + queueId).html("...");
    $('#uploader' + queueId).find('a.lightbox').divbox({ /* and whatever options you need */ });
    

    Rough demo of the technique: http://jsfiddle.net/ambiguous/EswfB/

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

Sidebar

Related Questions

On my asp.net 4.0 site I have a upload function which allow a user
I have an upload form with a file to be uploaded. The issue I
I'm developing an application for transferring databases and directories of user-uploaded images/documents from our
I have an upload form for an image. When user selects a file, I
I have a contest entry site that requires a file upload to an external
I have download the code for OpenFileDialog (File Upload function) from Silverlight tutorials website.
We have a function in our Rails code that accepts a JSON POST body:
I have an upload function in an MVC 3 project which store the files
I have some PHP file upload function that worked perfectly well. For some reason
I have file upload using jquery form plugin as $(function() { $(#Form).ajaxForm({ iframe: true,

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.