• Home
  • About Me
  • Resume
  • Useful Links
  • Português
  • Contact

EmanuelCosta.com

E-Commerce, SEO/SEM/Online Marketing, Web Development, Usability, WordPress & WooCommerce

  • LinkedIn
  • Twitter
Home » Archives for September 30, 2007

Archives for September 30, 2007

jquery, thickbox and iframe

Posted on September 30, 2007 Written by EmanWeb

I am using jquery‘s thickbox 3.1 for an image gallery. My problem started because the previous developer made the site using iframes. I strong recommend you not using iframes or frames, and there are many reasons for you to not using them.

Of course this is a hack, and the best scenario you shouldn’t use frames and then do the coding in “perfect” manner.

In order to make the thickbox work inside an iframe you must do the following:

1 – Add jquery and thickbox files to both main and iframe pages. This is required so the previous and next link works on the inline popup (thickbox).

2 – Make the following changes to the thickbox.js file

2.1. – Replace the code inside the function tb_init(domChunk) tb_show(t,a,g); to self.parent.tb_show(t,a,g,window);

2.2. – Replace
function TB_show(caption, url, imageGroup)
to
function TB_show(caption, url, imageGroup, refWindow)

2.3. – Replace
TB_TempArray = $(“a[@rel=”+imageGroup+”]”).get();

to

TB_TempArray = refWindow.$(“a[@rel=”+imageGroup+”]”).get();

2.4. – Replace
tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
to
tb_show(TB_PrevCaption, TB_PrevURL, imageGroup, refWindow);

2.5. – Replace
tb_show(TB_NextCaption, TB_NextURL, imageGroup);
to

tb_show(TB_NextCaption, TB_NextURL, imageGroup, refWindow);

3 – Now the code for your links must be something like this:
Image Title

That’s all you need. It took me while to figure this out. On the internet I found some information but it was confusing so I decided to compile everything in one post. I hope this helps anyone looking to do the same.

  • delicious Bookmark on Delicious
  • digg Digg this post
  • facebook Recommend on Facebook
  • linkedin Share on Linkedin
  • reddit share via Reddit
  • stumble Share with Stumblers
  • twitter Tweet about it
  • rss Subscribe to the comments on this post
  • print Print for later
  • email Tell a friend

Filed Under: JavaScript, Web Development

Find Here

About me

Hello, my name is Emanuel Costa. I build professional websites and help companies grow online. I write this blog to help myself about what I learned and perhaps help other people. I help organize meetups and whenever I can I attend tech events, specially WordCamps. Read more about me. (p.s.: Agora escrevo um blog em Português aqui: emanweb.com.br

Latest WordCamp:

WordCamps I Attended:

I am volunteering at WordCamp Las Vegas 2019″ title=

WordCamp Fortaleza

I'm attending WordCamp San Diego

I am Attending WordCamp Miami 2016


WordCamp US

Categories

  • ActionScript
  • Blogs
  • ColdFusion
  • CSS
  • Experience
  • Flex and Flash
  • Gadgets
  • Google
  • JavaScript
  • Linux
  • MySQL
  • PHP
  • SEO
  • SEO and Internet Marketing
  • SQL Server and T-SQL
  • Uncategorized
  • video
  • Web Development
  • WooCommerce
  • wordcamp
  • WordPress
September 2007
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
« Aug   Jan »

Recent Comments

  • Peter Crouch on How to output a list of IDs in a field as recordsets / Como retornar uma lista de IDs como recordset
  • Simon on cPanel on AWS EC2 using Amazon Linux w/ Yours Nameservers
  • WordPress Developer? Really? - EmanuelCosta.com on Gracie Brazilian Jiu Jitsu and WordPress. What these two have in common?

Follow Me

  • Linkedin
  • Meetup
  • RSS feed
  • @emanweb

Navigation

  • Home
  • About Me
  • Resume
  • Useful Links
  • Português
  • Contact

Need quick tech advice? Pick my brain:

Copyright © 2025 · Focus Pro Theme on Genesis Framework · WordPress · Log in