Archives:
Sunday, April 5, 2009

Creating your Own Lightbox: 2

The Main Part Box & JavaScript

Well previously I posted on the basics of creating a lightbox, I shall explain the code for one of my most basic creations as once you understand this you can take it a lot further.

So I shall start with the JavaScript:

function lightbox(id1){
if(document.getElementById(id1).style.display==”block”){
document.getElementById(id1).style.display=”none”;
document.getElementById(’lightbox’).style.display=”none”;
}else{
document.getElementById(id1).style.display=”block”;
document.getElementById(’lightbox’).style.display=”block”;
}
}

Essentiall all it is doing is checking if id1 is already open if its shown as a CSS display block it will close id1 and lightbox id, else it will open them.

This keeps the script nice and short no bloated effects like Lightbox2 or jQuery lightbox, now in your html all you need to do is:

<div id=”mybox” class=”lightbox” style=”display:none;”>

stuff you want in lightbox

<a href=”javascript:lightbox(’mybox’)”>Close Lightbox</a>

</div>

You can see I’ve set display:none; this is very important just because we are hiding the box, yeah not good for the search engines but for now it works, when you get more advanced I would have a class called hide, and apply it to the div tag just to keep google happy.

Comments (4)



Monday, February 23, 2009

Creating Your Own Lightbox

One thing that bugs me is these lightboxes and the lack of support on forums, you ask about lightboxes and they just link you to lightbox2 or ibox and all this junk which quite frankly is appaling, no one takes the time to explain the process of a lightbox.

My job recently involved constructing a lightbox, after a few days of racking my brains at other scripts I just put them in the trash bin as they where exactly as described trash bloated scripts for something I really dont need that much.

transparent spacer

All I wanted was a fixed lightbox, nothing special like floating above the entire site, I wanted to click x and it would bring up some funky box.

So I just started thinking about it and essentially, its just 2 layers 1. your grey overlay and 2. your box you want.

lightbox

Hopfully you can see with my porley constructed diagram, as you can see layer 1 is under layer 2 but they are both over the website… this really is all you need to keep in your mind.

Comments (2)



Thursday, January 22, 2009

Windows XP Time to Run it Right!

So I recently purchased a new copy of Windows XP before I used to maybe re-format my hard drive every 1 year or so due to obvious reasons of windows lacking the ability to run well past the first year.

The usual stuff you had to do to keep windows running was a defrag, clean up temp files, empty the bin… well the list goes on and in reality we never did it. It maybe got cleaned once every 2 months if lucky, so I shall tell you how to do it automatically.

We shall begin with installing the usual, CCleaner and also put JKDefrag in your program files.

So we want to setup a simple batch file to run CCleaner and JKDefrag, you can however set JKDefrag to run when your screensaver appears but I can’t say I like screensavers that much.

Anyway we shall make the batch file (something.bat) in say C:\ (just for simplicity)  then in that we will put this in it

“%PROGRAMFILES%\CCleaner\CCleaner.exe” /AUTO
“%PROGRAMFILES%\JK Defrag\JkDefragCmd.exe” -a 2 -s 40 -d 2 C:

Comments (1)



Wednesday, January 14, 2009

Ultra Mobile Laptops, Netbooks

I take it you have heard about these new ultra mobile laptops (netbooks), well their not really new but they hit the blogs a lot when they came out, their was a lot of excitement over the Asus Eee laptop rightly so considering its a nice netbook.

Now me I’m too cheap to buy one at the retail price, instead I went one better and used ebay to buy myself a Compaq Evo N400c, now yes it might be 2-3 inches bigger but its a classic and repairable when something goes wrong, I’ve done a few fixes to it such as replacing the hard drive due to the old one failing unfortunately its a higher capacity but what you gonna do its all I had.

As I’m a complete computer nerd I did some upgrades and downgrades to it, I increased the RAM by another 256MB yep nothing in today’s standards but its still nice enough to run Windows 2000 without any trouble. As I just said I have Windows 2000 on it as XP was on it previously who puts XP on a laptop built for Windows 98 seriously? Well same could be said about Win2k but it runs quite well.

Comments (3)



Saturday, December 13, 2008

Synergy, dual display desktop.

Well for years not I’ve been wanting to try out Synergy, I just never got around to it for many reasons such for lack of a personal network and not many computers to try it out on.

But after working with computers for a few years not I’ve built up a few scrap computers, and some old laptops on the edge of breaking down.

So my current synergy setup is a old 1.8 ghz single core desktop, and a 800mhz laptop (which I’m grown quite fond of) but the mouse is broken on the laptops keyboard which pushed me to try out synergy as the small screen is perfect for writing blogs, checking forums and the whole social side of things!

My Desktop I use for designing/developing websites, so it has to run quite resource hungry apps (which is a struggle for it) so this also brought me to using two computers at once, so on my laptop I can just run my browsers to see how the website is coming along and on my desktop I can just have open Dreamweaver and Photoshop.

Comments (1)



Pages: 1 2 3 4 5 6 7 8 ...29 30 31 Next

Recent Posts

  • Creating your Own Lightbox: 2
  • Creating Your Own Lightbox
  • Windows XP Time to Run it Right!
  • Ultra Mobile Laptops, Netbooks
  • Synergy, dual display desktop.
  • A Quick Look at Opera 10
  • Image Smilie Flag Generator
  • My Choices of Content Management Systems
  • SEO on the bench (Watching your Logs)
  • ZenWalk, Slackware Based Operating System
  • POTW: Ultra VNC
  • N-Design Studio
  • Plusmo is scraping my content!
  • Wordpress Theme: Sleek
  • Black Hat SEO, To Use and Abuse or Avoid?
  • Wordpress Update 2.3 Rocks!
  • Typer Tappers Birthday!
  • Apple Ipod Touch Sexiest Ipod Out (itouch)
  • Adobe Photoshop CS3 Upgrade
  • Leaving footprints online good or bad?