Getting rid of the border around popup images

What you think other Nucleus users should know!
karma
Posts: 983
Joined: Fri Dec 07, 2001 4:25 pm
Contact:

Getting rid of the border around popup images

Postby karma » Fri Dec 14, 2001 1:43 pm

When using popup images in Nucleus v0.96, the default templates and skins generate a popup window that's slightly bigger than the image (40 pixels), resulting in a white border around the image.

To change it so that windowsize = imagesize, follow the following steps:

1. 'hack' into nucleus/libs/BLOG.php and change the lines 227-228 from

Code: Select all

      $windowwidth = $width + 20;
      $windowheight = $height + 20;

to

Code: Select all

      $windowwidth = $width;
      $windowheight = $height;


Change the same on lines 245-246 too (hmm, that's sort of a bug)

(I'll change that in the next version, 0.97. Adding that 20 pixels was a bad idea)

2. update the image popup skin (in the default skin, or whereever you have defined it)

change

Code: Select all

  <style type="text/css">
   img { border: none; }
  </style>

to

Code: Select all

  <style type="text/css">
   img { border: none; }
   body { margin: 0px; }
  </style>


Optional: if you want to close the popup window when it loses focus (i.e. means the visitor clicks another window), change the body tag to the following:

Code: Select all

<body onBlur="window.close()">


That should do it :)
msary80
Posts: 1
Joined: Tue Jan 22, 2008 8:10 am

Postby msary80 » Tue Jan 22, 2008 8:21 am

Thank karma, These code is helpful . That's a good idea.

________________________________
Download
Posts: 174
Joined: Tue Oct 02, 2007 6:58 pm
Location: Belgium

Postby Download » Tue Jan 22, 2008 1:10 pm

"in Nucleus v0.96"
Your a bit behind my friend..
The current version is 3.3, isnt it time for you to update ?
User avatar
IHNBIIPOS
Posts: 324
Joined: Tue Aug 16, 2005 1:40 pm
Contact:

Postby IHNBIIPOS » Tue Jan 22, 2008 4:32 pm

Posted: Fri Dec 14, 2001 1:43 pm


Necro topic! :lol:
My sites using Nucleus: AgeOfConan.lt | AglocoLietuva.com
If you like Nucleus: Digg it | Stumble it | Save to del.icio.us | Donate
Download
Posts: 174
Joined: Tue Oct 02, 2007 6:58 pm
Location: Belgium

Postby Download » Tue Jan 22, 2008 5:03 pm

WoOpz, didn't noticed the date :P
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Tue Feb 03, 2009 12:53 am

I wouldn't try this in 3.33. The code has changed a lot since the original post. It is probably doable by some simpler means now (like a template, or css).
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.

Check out my plugins
User avatar
WillyP
Nucleus Guru
Nucleus Guru
Posts: 872
Joined: Sun Aug 30, 2009 3:29 am
Location: Pembroke, NH
Contact:

Postby WillyP » Fri Dec 03, 2010 1:03 pm

3.3? Latest is 3.51 and soon to be 3.6.

Anyway, check out some of the modal boxes like shadow box, color box, or media box.

Return to “Share Your Tips & Tricks”