Posts Tagged ‘image’

WordPress Plugin Releases for 03/11

Thursday, March 11th, 2010

New Plugins

WP-ZoomImage With CopyProtect

You can pop up an image or thumbnail by just clicking on it and it will disappear when you click it again

Titled Comments

Hikari Titled Comments enables each comment to have a title, so that commentators can give a subject meaning to their comments.

Scroll to Top Plugin

Integrate a jQuerry scroll to top control in WordPress manually

Tweet my Script

This plugin watches your Twitter RSS Feed for user-defined “launch codes” to trigger user-defined script URLs.

Dojo Skew Gallery plugin for Wordpress

This is a plugin to create a skew photo gallery utilising Dojo Toolkit Ajax.

Updated Plugins

AVH Extended Categories

The AVH Extended Categories Widgets gives you three widgets for displaying categories.

Smarter Navigation

A WordPress plugin that generates previous & next post links based on referrer. Version 1.2 adds a utility for posts in multiple categories.

Smarter Navigation

Generates previous & next post links based on referrer. Version 1.2 adds a utility for posts in multiple categories

SEO Automatic WP_CORE_TWEAKS

Extends built-in features of Wordpress and combines common plugins into one.

WP ImageTagger

This extensively configurable plugin comes packed with a bunch of features enabling image tagging, including search and image taxonomy.

Read more:
WordPress Plugin Releases for 03/11

The Best Sites For Free MySpace Templates

Thursday, March 11th, 2010

MyHeadLooking at the statistics online, a lot of you are still using MySpace (mostly the younger generation) and I am sure you would love some new sources for free MySpace templates. I will run down a few sites my younger cousin uses for just that.

We will start off with FreeLayouts. When you arrive at their site you will see templates for normal websites, blogs, as well as MySpace. Click on MySpace Layouts in the main navigation menu and then you will see more specific sections.


The sections are CSS< XHTML, 2 Column, Fixed Width and eleven different colors as you can see below from the screenshot.

free MySpace templates

Here are some of the free MySpace templates that were displayed on the homepage while I was checking it out. Notice a lot of themes surrounding holidays.  Valentines Day that just passed and St. Patrick’s Day which is coming up.

free MySpace templates

You can click on preview to see a close up view of what the template really looks like. That will bring up this window:

free MySpace templates

You can click on the Get Code button to retrieve the code you will need to integrate the template like so:

myspace templates

Simply highlight the code and paste it into your About Me section of your MySpace profile to get started. I clicked on the box, hit control A to select all of it, and then control C to copy it and finally control V to paste it where it needs to go.

You also have the option of setting up an account and creating favorites that you can refer back to.

The next website for free MySpace templates we will be looking at is called MySpaceLibrary.

myspace templates

I scrolled down and chose layouts and started browsing around what they had to offer.

myspace templates

Looking around they have a little something for everyone. I found sports templates, music templates, geeky templates…seriously if you use MySpace you will be able to find something here!

After finding the template that you like, click on the link below it that says Click to view large and get MySpace codes.

That will take you to this page:

my5

Just like before, if you want to use it copy the code and paste it into your About Us page on MySpace. To view the template click on the preview button below the picture of the image. That will show it to you like this:

my6

The last site we will be checking out is called MySpaceSkins.

my7

Scroll down when you get to the site and you will see the templates. The first section is called Girly MySpace Layouts followed by grunge, fashion and beach layouts as you can see below:

my8

Click on one of the layouts or on a More [Category] MySpace Layouts button to see more related layouts. After selecting a layout you will see something that looks like this:

my9

You can grab the layout code as we have before for the other sites but here we have some other choices like customizing the layout with their online MySpace profile editor.

my10

or adding a custom Google search box on the page.

my11

If you have other sites and resources hook us up and leave the URLs in the comments!

Did you like the post? Please do share your thoughts in the comments section!


Related posts



See the article here:
The Best Sites For Free MySpace Templates

Top 5 Internet Fraud & Scams Of All Time

Wednesday, March 10th, 2010

If you’ve been using the Internet, and specifically email, for any length of time, then by now you’re most likely aware of most of the common email scams that exist online. Dean covered the five most common email scams, so if you aren’t familiar with them, then please take the time to read his thorough article.

Beyond just basic email scams, there are other methods that scammers use to defraud people of their money through the Internet. Today, I would like to examine five additional Internet scams that are very commonplace, but unfortunately not quite as many people are aware of them.

These are scams that trip up the most people every year and lead to a substantial financial loss. Take the time to read through and understand these scams so that you never find yourself a victim of them.

Nigerian Scams Revisited

I remember watching a documentary a few years ago that detailed how scammers, usually located in third world countries, set up computer clusters connected to the Internet and send out thousands of Nigerian scam emails every day.

The name of the scam comes from the original form of this scam, which consisted of emails outlining a situation in Nigeria that required a massive transfer of money from that country into the United States for safety. For assisting with the money transfer, the recipient of the email is promised a percentage of the transfer amount, usually totaling hundreds of thousands of dollars to a few million.

Once this came became widely known, it immediately evolved and continues to evolve even today. It now takes a very wide variety of forms including the elderly sick person looking to transfer their entire estate into your bank account.

top internet fraud scams

Then there is one of my personal favorites, the young woman in danger who is seeking a savior to help her – and of course she has a very large sum of money to offer as a reward. Here is an email from “Miss Diana” of West Africa, who has a DC worth $5.9 million, and is seeking to escape her country and live in the United States.

top internet fraud scams

The scammers put together storylines and plots that appeal to the basic human emotions of greed, goodwill and love. In some cases they almost always reference God in some way – in an effort to appeal to western Christian values. In the end, the many variations of the Nigerian scam end in only one place if you offer up any of your contact information or, even worse, your bank account information – an empty bank account.

Scammed By A Counterfeit Website

The second most common Internet scam is email phishing. Dean mentioned this in his article (fake links in emails to banks or Paypal), and MUO covered SonicWALL, which can detect phishing emails. However, did you know that even if you don’t click on a fake link and you follow the advice to type in your bank or Paypal’s URL directly into the browser, that the site could still be counterfeit?

It’s true. If you visit the wrong website or download the wrong file from an infected email attachment, you could end up with malware on your PC that specifically targets a browser security flaw. Internet Explorer seems to be the most vulnerable to these. The Malware basically re-routes your browser URL query to a different page than the domain that you typed in.

top internet fraud scams

Because the scammer has altered the DNS settings for a specific website or hijacks your browser, it’s very hard to realize that you’re actually visiting a counterfeit version of the site you intended to visit. How do you prevent such a scenario from happening to you?

First, run MalwareBytes religiously. Second, keep your browser fully patched and updated. And finally, be vigilant about anything on the website that seems a bit odd. Thankfully, most major banks are catching on to this problem and are starting to incorporate a unique image of your choosing into the login process. Each time you log in, the website asks you to confirm the image. If the website doesn’t ask you to confirm, or it’s the wrong image, then you know you may be visiting a counterfeit site.

Three Major eBay Scams

While the Nigerian scams and phishing emails with fake links are the two most common Internet scams, the popularity of eBay over the past decade has led to another whole family of Internet scams. There are three significant scams that you should be aware of if you’re an eBay user. The first is a scam that targets eBay sellers, and it involves the scam artist obtaining a matching broken item that’s identical to the item that you’re selling. Often, such scam artists will actually purchase one right off eBay that’s in need of repairs or otherwise has some damage to it at a fraction of the cost of a new one.

internet fraud

Then they will purchase your identical item, which is in perfect condition. They’ll make payment to you, receive your item, and then email you to say that the item was damaged in shipment. Often, they’ll threaten to give you negative feedback (a hard thing to deal with as an eBay seller). Many sellers simply cave and send a full refund, and the scammer returns the damaged item, keeping the working item for themselves.

Protect yourself from this scam by either requiring your buyers to purchase shipping insurance, or doing what the seller in the above example did and put in writing that all sales are final, and no returns are accepted.

internet fraud

The insurance option is the best approach because it removes all liability from you as the seller. If the buyer claims that the device was damaged in shipment, it’s up to them to prove it to the postal service, and face fraud charges if they are found lying.

The second common eBay scam is the Auto Scam. The Motors section of eBay is a bustling auto marketplace where huge volumes of sales take place every day. Unfortunately, because these are big ticket items, and because the financial transactions on eBay are not very secure for buyers, the marketplace is very attractive to con artists.

The con is very simple. First, they list a very popular big-ticket auto that they actually don’t even have. Sometimes they’ll even just steal photos from other listings.

internet fraud

Now, I don’t know if the listing above is authentic or not, but I offer the listing as an example of how much money is at stake. If you really want this car and you don’t live near enough to inspect it, you might be willing to cough up payment, or even a partial payment, at the end of the sale. Don’t do it. There are far too many examples where people have sent in a significant chunk of change, and the seller simply disappeared without a trace. Never bid on an auto on eBay Motors unless an on-site inspection by you or a third party on your behalf is agreed upon.

The last eBay scam is shown above. As a seller, you’ll get used to notifications from eBay, and sometimes it’s easy to assume they’re all authentic. Scammers will scour completed eBay sales and then send these fraudulent emails to the seller, as though it’s from eBay’s automated system. The goal of the email is to get you to click on the link and log into your eBay account. The moment you do – your eBay account and all financial information contained therein, is compromised.

Have you ever been “taken in” by an Internet scam? Do you know of any other popular Internet fraud or scams that are floating around out there? Let readers know in the comments section below.

Did you like the post? Please do share your thoughts in the comments section!

New on Twitter ? Now you can follow MakeUseOf on Twitter too.


Related posts



Read more from the original source:
Top 5 Internet Fraud & Scams Of All Time

PDF-XChange Viewer – Give This Free PDF Reader A Second Look

Tuesday, March 9th, 2010

Last month we took a look at the Nuance PDF Reader, a desktop app which can convert your PDF document into its Word, Excel or Rich Text equivalent. A few readers liked the conversion bit among its features. A few of them also put in a good word for another free PDF reader. No, it’s not Adobe Reader or Foxit, but a relatively played down one called PDF-XChange Viewer.

On second thoughts, the last sentence would be misplaced. Taking CNET’s download figures for document management software, I see that it’s behind Foxit and Adobe Reader. But the download numbers are really noteworthy.


So why do a review of the PDF-XChange Viewer so late in the day? In response, I say…why not? The fact that a number of our readers have put in their nod for this free PDF reader is reason enough to take a second, more prying look.

We have featured it before, albeit briefly, in a post on 4 Really Light Alternatives to Adobe Reader and in 6 Ways To Convert A PDF To A JPG Image. But it’s time to give PDF-XChange Viewer some limelight of all its own.

The free version of PDF-XChange Viewer, which we are interested in, is a slim 18MB download. That makes it heavier than Foxit but lighter than Adobe Reader. You can get it in various installation packages including a portable version.

The first thing you will notice with the first run is that the free PDF reader loads very fast. So let me load one of our own MakeUseOf eBooks and play around with the features that are there.

free PDF reader

The first pleasing thing is it has a slick tabbed interface, letting me view more than one PDF file within one instance of the program. While choosing the components during the installation process, you will notice that PDF-XChange Viewer’s Help file has a requirement of nearly 6MB. This translates into a comprehensive and detailed Help file for the guy who likes to know his software in and out.

free PDF reader

The toolbar seems to be a bit cluttered. But that’s because, by default, the software loads all the toolbars. You can set it up to your liking with a right click on the toolbar area and choosing Customize. A glance at the toolbar buttons gives you an idea of the features to expect. Features that are part of the paid Pro version are marked as such.

The Key Features That Make Up PDF-XChange Viewer

PDF-XChange Viewer makes navigation smooth with its Pan and Loupe tools located in the Zoom Toolbar. Zooming in and out with the slider is one way. Both the Loupe tool and the Pan and Zoom tool open up navigation windows and help to focus on specific areas of a PDF document.

free PDF reader

PDF-XChange Viewer not only has a document search box but also a web search toolbar that’s set first on Ask.com (more engines can be added from Preferences). Click the dropdown to choose from the other search providers. For searching within the document, you can also comb through added comments and bookmarks.

download free pdf reader

PDF-XChange Viewer can be used as a ‘limited’ document converter. PDF pages can be exported to a variety of image formats. The Export to Image dialog box is also rich in features as in the screenshot.

download free pdf reader

You can easily email a PDF document from within the reader itself. The title of the document is entered in the Subject line of the email.

PDF-XChange Viewer shows the capability to handle interactive forms (AcroForms). The Form Data menu choice allows you to enter and retrieve data from Adobe Acrobat Forms. PDF-XChange Viewer has a few View options, for instance, View – Other Panes – Fields opens up a side pane with all the form fields. Along with form field highlighting, it makes the fields more obvious.

download free pdf reader

Commenting & Markup Tools

Every PDF reader has its uniqueness. With PDF-XChange Viewer it could be its rich subset of commenting and markup tools. Here’s a snapshot of the sub-menu accessed from Tools – Comment and Markup.

pdf reader

PDF-XChange Viewer gives you all the aids for elaborate markups with a variety of shape and line tools. And if you want to bump up the detail, there’s the free form Pencil tool for some freehand rough sketches.

pdf reader

You can add comments and annotations to any PDF file. The Sticky Note tool adds a Sticky Note wherever you need one for commenting. Others can also add replies below the main text by clicking on Add Reply. The appearance of the text and the container box can be changed anytime.

pdf reader

The Callout Tool allows you to add a text box with an arrow pointing to a selected location on the page.

For some straight-cut text annotations, you can use the Typewriter or the Textbox Tool.

The Stamps sub-menu is for marking documents with your choice of stamps. You can add your own stamps, for instance, your scanned signature via the Stamps Palette.

For more of navigation between internal and external locations, the Link Tools are just two steps down. You can link to any internal point in the PDF document or to an external website.

More Below The Surface

The above lines highlight the more conspicuous features of PDF-XChange Viewer. Scratch the surface and there’s more. Check out the Preferences and for customization options. For the paranoid, there’s 40/128 bit RC4 and 128/256 bit AES Encryption and Password security support.

Go into the Preferences and you can set a few memory usage and performance tuning options.

Along with the extremely detailed Help file, you get an informative product page on their website with screenshots and how-to videos to guide you through the product.

Downsides? Not many. Perhaps, the ability to add your own bookmarks in the free version would have helped. Hey, you can’t win every round with a product that’s absolutely free. PDF-XChange Viewer does win most of them.

Take it around for a few rounds and compare it with your experience in either Foxit or the Adobe Reader.

PDF-XChange Viewer (ver.2.0) is supported on Windows 2000 and all later versions.


Related posts



Read more:
PDF-XChange Viewer – Give This Free PDF Reader A Second Look

WordPress Plugin Releases for 03/05

Friday, March 5th, 2010

New Plugins

Wordpress External Cron

Allows you to setup a cron to fetch any page on the server

PuSHPress

This plugin adds PubSubHubbub ( PuSH ) support to your WordPress powered site. The main difference between this plugin and others is that it includes the hub features of PuSH, built right in. This means the updates will be sent directly from WordPress to your PuSH subscribers.

Block Bad Queries

Protect WordPress Against Malicious URL Requests

Image Space Media

The ISM plugin optimizes your Wordpress blog for Image Space Media’s in-image advertising technology. With the ISM plugin, Wordpress users can seamlessly integrate Image Space Media’s in-image advertising solution into their website and generate ad revenue.

Easily navigate pages on dashboard

Display a folder tree of your pages that is easy to expand and contract on your Dashboard. Designed for people that use Wordpress as a content management system.

MySQL Profiler

WordPress is extremely flexible. However, flexibility generally brings about the issue of performance. WP MySQL Profiler is a simple plugin that assists in improving performance of themes and plugins.

Updated Plugins

Easy Review Builder for WordPress

Create attractive star ratings for reviews. Supports multiple rating categories and an optional auto-calculated summary

Dynamic “To Top”

Adds an automatic and dynamic “To Top” button to easily scroll long pages back to the top.

Read this article:
WordPress Plugin Releases for 03/05

How to Create a Nifty Dynamic Shadow with jQuery

Friday, March 5th, 2010

Dynamic shadow preview pictureFirst I want to welcome you to my very first article for 1stwebdesigner. Today I’ll show you how to create a very nifty looking dynamic shadow with a few teaspoons of jQuery, a pinch of CSS and some transparent PNG’s as Base. I’ll explain every line of used code, so you can easily follow along and create your own awesome looking dynamic shadow powered by jQuery.

Introduction

When I first published my jQuery shadow experiment, I got a huge response from the community and a lot of people asked me, how I achieved this effect and if I’m going to write a tutorial for it – So here it is now!

If you want to follow along with the source files, you can download them by clicking here (*.zip archive).

Step 1: Creating the transparent PNG’s

First we need to prepare all PNG files we’re going to use. We’ll need following image elements:

  1. The on/off switch (needs two states)
  2. The light source (in this case, a sexy light bulb – also with two states)
  3. The object which is going to drop the shadow (here it’s going to be a logo)
  4. and last but not least, the matching shadow of our logo

We’re going to use the CSS sprite technique for reducing HTTP requests. So we’ll need 3 images (otherwise we would need 6 separate images and twice as much HTTP requests).

1st PNG Image: The Light-Switch Sprite

Light-switch sprite

2nd PNG Image: The Light-Bulb Sprite

Light bulb sprite

3rd PNG Image: The Logo Sprite

Logo Sprite

I’m not going to explain how to create those images, as I’ll concentrate on the source code. If you want to use your own images, just make sure to save your images as PNG 24 , so your transparency gets saved too.

Step 2: Preparing our HTML, CSS & JS files

To make your files well-arranged, we’re going to create following folder structure for our files now:

Folderstructure

The root folder (dynamicShadow) will contain our index.html with all layout containers inside of it. Inside of the img folder, you should put all three PNG image files you created or copied from step 1 above. Inside the css folder create a file named style.css. There we’ll style all layout elements we used in the html file. And the magic will happen inside of the js folder. There we’ll create a file named script.js. It will contain our jQuery JavaScript code.

If you have done those two steps above, we are now ready to go on and finally let the magic happen!

Step 3: Writing the HTML file with all containers we will use

First we need to include the files we created in the previous step, into the header part of our HTML.

First our stylesheet file:


Now we’ll attach the latest version of jQuery itself and jQuery UI from Google’s AJAX Libraries repository:



Last but not least we need to attach our JavaScript file (script.js):


Our header should look something like this now:



	

	
	
	

We can start with the body part of our HTML now:

We’re going to need following div’s with the same id’s for the next step, where we are going to style our containers.


Please activate JavaScript!

For explenation:

  1. “switch” will be our element, which is going to turn the light bulb on and off.
  2. ”light-bulb” and “light-bulb2” are our containers with the actual light bulb (I’ll explain later why we need it twice). Just make sure you don’t forget to add the “off” class to the outer light-bulb container.
  3. ”logo” is our element which is going to drop the shadow.
  4. ”logosh” will contain the appropriate shadow for the object.
  5. ”infobox” is just a bonus and not mandatory for our effect. It will contain some status messages. Additionally it contains a message for all (bad, bad) users, who are visiting your site with deactivated JavaScript. You can write them a message there. Take care at your diction, don’t be too evil to them ;) .

Step 4: Let’s get some colors into our HTML file!

Now we’re ready to style our HTML with the CSS file we included into our header.

We will start with the info box. If you have chosen to include it, here is a styling suggestion:

#infobox {
	position:absolute;
	width:300px;
	bottom:20px;
	left:50%;
	margin-left:-150px;
	padding:0 20px;
	background:rgba(0,0,0,0.5);
	-moz-border-radius:15px;
	-webkit-border-radius:15px;
	z-index:999;
}
#infobox p {
	display:block;
	color:#D1D8DF;
	font:bold 15px/10px Tahoma, Helvetica, Arial, Sans-Serif;
	text-align:center;
}

For the #infobox we are using some CSS3 to make it prettier. The background is black and 50% transparent with the awesome rgba attribute and the corners are rounded with a 15px wide diameter through the mozilla and webkit specific attributes. The box will be 340 pixels wide (300 + 2 x 20) and placed centered on the bottom of our page. With the z-index set to 999 it will be the topmost element in our page so it does not get covered from our logo, the shadow or the light bulb.

Next is our switch:

#switch {
	position:absolute;
	bottom:50px;
	left:50px;
	width:80px;
	height:120px;
	background:url(../img/light-switch.png) -80px 0 no-repeat;
	cursor:pointer;
	z-index:100;
}

It will be absolute positioned to the bottom left corner of our page. The backgrounds X position is set to –80px. There we are using the CSS sprite technique the first time. The cursor is going to be a pointer, so the user knows that he can click it. z-index to 100. The logo, the shadow and the light bulb must get a higher z-index, so they don’t disappear behind the switch.

Now let’s style our two light bulb containers:

#light-bulb {
	position:absolute;
	top:20%;
	left:70%;
	width:150px;
	height:150px;
	background:url(../img/lightbulb.png) -150px 0 no-repeat;
	cursor:move;
	z-index:800;
}
#light-bulb2 {
	width:150px;
	height:150px;
	display:none;
	background:url(../img/lightbulb.png) 0 0 no-repeat;
}

The backgrounds X position of the main light bulb container is set to –150px. This is the “turned off” state of our sprite-image. The “inner light bulb” (light-bulb2) is set to “top left” (0 0), so it is the “turned on” state of the sprite. Later we will animate the opacity of it from 0% to 100% and create a smooth blend effect from the on to the off state and reverse. z-index to 800: It will be above the switch, above the logo and above the shadow but behind the info box. The cursor attribute is set to “move”. This way the user will get a nice, OS-based cursor which tells him he can move this object around.

Our last two containers are the logo with his shadow:

#logo {
	position:absolute;
	top:40%;
	left:20%;
	width:450px;
	height:150px;
	background:url(../img/logo.png) 0 0 no-repeat;
	cursor:move;
	z-index:700;
}
#logosh {
	position:absolute;
	width:450px;
	height:150px;
	display:none;
	background:url(../img/logo.png) 0 -150px no-repeat;
	z-index:600;
}

The main logo containers gets also the “move” cursor and the background position is set to “top left” again. This will show the main part of our logo sprite. z-index to 700. It’ll be above the shadow and above the switch, but behind the light bulb and the info box.

The shadow container gets z-index of 600 and the backgrounds Y position is set to –150px. It’s the shadow part of our logo sprite-image.

If you came this wide, your index.html file should look something like this in your browser (of course only, if you used the same image files of this tutorial):


Dynamic shadow NoJS

Now let’s get this party started and add some spice to our page. We will write some JavaScript now!

Step 5: The magic starts to happen now!

Ok now let’s go with the interesting part of this whole tutorial. First we start with the jQuery’s main function:

$(function(){

});

This is the short hand code for jQuery’s document.ready(). Our whole script needs to be inside of this function, so it gets loaded, as soon as the DOM is ready.

Next we’ll define some variables and set the default text of our info box. The descriptions are inline as comments:

// shadow offset
var shadowOffset	=	1.08;

// the light switch
var lightswitch		=	$("#switch");

// outer light bulb
var lightbulb		=	$("#light-bulb");

// inner light bulb
var lightbulb2		=	$("#light-bulb2");

// center of light - X-axis
var lightCenterX	=	parseInt(lightbulb.width()/2);

// center of light - Y-axis
var lightCenterY	=	parseInt(lightbulb.height()/2);

// logo container
var logo			=	$("#logo");

// light and logo containers
var lightAlogo		=	$("#light-bulb, #logo");

// center of logo - X-axis
var logoCenterX		=	parseInt(logo.width()/2);

// center of logo - Y-axis
var logoCenterY		=	parseInt(logo.height()/2);

// shadow container
var logoshadow		=	$("#logosh");

// center of shadow - X-axis
var logoShdwCenterX	=	parseInt(logoshadow.width()/2);

// center of shadow - Y-axis
var logoShdwCenterY	=	parseInt(logoshadow.height()/2);

// info-box text container
var statustext		=	$("#infobox p");

// info-box default text
var defaulttxt		=	"Drag the light-bulb or the logo!";

// info-box text for hovering switch while state is "off"
var ontxt			=	"Let there be light!";

// info-box text for hovering switch while state is "on"
var offtxt			=	"Switch off the light!";

// set info-box text to default text
statustext.text(defaulttxt);

// start our main function (will be used later)
moveShadow();

For now, you can comment the last line out. moveShadow(); will be our main function which will change the position of the shadow.

Now let’s get dynamic and let us make the light bulb and the logo draggable. We’re going to use jQuery UI’s draggable interaction element to keep things easy.

// making the light and the logo draggable
lightAlogo.draggable({
	drag: function(event, ui){

		// change the statustext do "dragging + element id" state
		statustext.text("dragging " + $(this).attr("id"));

		// our main function which will move the shadow
		moveShadow();

	},
	stop: function(event, ui){

		// switching to default text when stoped draging
		statustext.text(defaulttxt);

	}
});

While dragging, we’re going to set the status text of our info box to “dragging” + the id of the current element. So in our case it will be logo or light-bulb. When we release the mouse and stop dragging the current object, we revert the text to our default value.

Our two objects should now be draggable! Isn’t it easy with jQuery UI? :)
(There comes the “write less, do more” from, which is jQuery’s slogan.)

Again you can comment out the moveShadow(); function for now, if you want to try your code in the browser. This will be the main function which makes the dynamic shadow moving, while you drag either the light bulb or the logo.

With the following function, we’re going to change the default text of the info box to our on or off text when hovering:

// changing the infotext when hovering the switch
lightswitch.hover(function(){

	if(lightbulb.hasClass("off")){

		// when lightbulb has the class "off" show this text
		statustext.text(ontxt);

	}else{

		// otherwise show this text
		statustext.text(offtxt);

	}
},function(){

	// hovering out will show the default text again
	statustext.text(defaulttxt);

});

If the light bulb has the class “off”, then show the “on text”, else show the “off text”. When hovering out, the default text will be shown again. Still easy, right?

Next is our function for calculating the opacity of our logo shadow, according to the distance of the light source. In our case the light bulb:

// calculating the shadow opacity according to the light bulb distance
function setOpacity(getDistance){

	if(lightbulb.hasClass("off")){

		// if the lightbulb has the class "off", opacity = 0 (no shadow)
		return 0;

	}else{

		// otherwise we calculate a suitable shadow opacity with this formular
		return (1.2 - getDistance /1000);

	}
}

If our light bulb has the class “off”, we’ll return “0″, which stands for zero opacity. No light, no shadow. Sounds logical, right? More interesting is the “else” part, where we’re going to use this formula “1.2 – getDistance / 1000” to calculate a shadow which will look quite good. getDistance /1000 will just move the decimal point 3 points to the left, giving us a usable number for the next calculation, where we are going to subtract it from 1.2 (which would be 120% theoretically).You can experiment with this value, if you are not satisfied with the results.

The next what we are going to do is to assign the things which should happen, when the user clicks on our light switch:

// asinging the things, which should happen, when clicking the light switch
lightswitch.click(function(){

	// when the light bulb has the class "off" do following:
	if(lightbulb.hasClass("off")){

		// first remove the class "off"
		lightbulb.removeClass("off");

		// change the background position of the CSS sprite
		lightswitch.css("backgroundPosition","0 0");

		// showing the shadow of the logo with a fading animation
		logoshadow.stop().fadeTo(750,setOpacity(shadowDistance));

		// fade in the inner light bulb container (light is turned on!)
		lightbulb2.stop().fadeTo(750,1);

		// changing the status text to the "off text"
		statustext.text(offtxt);

	// else do following:
	}else{

		// adding the class "off"
		lightbulb.addClass("off");

		// move the background position of the switch back to original position
		lightswitch.css("backgroundPosition","-80px 0");

		// fade out the logo shadow
		logoshadow.stop().fadeTo(750,0);

		// fade out the turned on light (no more lights now)
		lightbulb2.stop().fadeTo(750,0);

		// changing the status text to the "on text"
		statustext.text(ontxt);

	}
});

A few things are happening now. Let’s get through it line by line.

First we need to differentiate if the lights should be turned on or off. For this we will check once again if the light bulb has the class “off” or not. If it has it, we’ll do following:

  1. We will remove it right again.
  2. Then we make use of our sprite image of the light switch and move it to the “on” position, which is “0 0″ / “top left”.
  3. After this we are going to fade in the shadow of the logo. We are doing this with the setOpacity function, described before. For now you have to change “shadowDistance” to “1”, if you want to try it. We will get the variable “shadowDistance” in the next function.
  4. Last things to do is to fade in our inner light bulb which is positioned via our CSS to get the “energized” part of the sprite image
  5. and change the status text to the “off state”.

If the light bulb has not a class named “off”, we will do the opposite of above which is following:

  1. add class “off” to our light bulb
  2. move the image of the light switch up by 80 pixels, so it is turned off again
  3. fade out the shadow
  4. fade out the inner light bulb (the lighten up one)
  5. and changing the status text to the “on state”

The last function we need is finally the one, which will move our shadow (and probably the most interesting one):

// the main function - our shadow mover
function moveShadow(){

	// save the current X position of the light bulb
	lightX			=	parseInt(lightbulb.offset().left) + lightCenterX;

	// save the current Y position of the light bulb
	lightY			=	parseInt(lightbulb.offset().top) + lightCenterY;

	// save the current X position of the logo
	logoX			=	parseInt(logo.offset().left) + logoCenterX;

	// save the current Y position of the logo
	logoY			=	parseInt(logo.offset().top) + logoCenterY;

	// save the value how far the logo is away from the light bulb on the X-axis
	distanceX		=	logoX - lightX;

	// save the value how far the logo is away from the light bulb on the Y-axis
	distanceY		=	logoY - lightY;

	// calculating and saving the value of the square root of those two distance values
	distance		=	Math.sqrt(Math.pow(distanceX, 2) + Math.pow(distanceY, 2));

	// calculating and saving the shadow distance with the offset we defined in our variables
	shadowDistance	=	distance * shadowOffset;

	// preparing the CSS value to put into the "left" attribute of the shadow container
	shadowPosLeft	=	(distanceX / distance * shadowDistance + lightX - logoShdwCenterX) + "px";

	// preparing the CSS value to put into the "top" attribute of the shadow container
	shadowPosTop	=	(distanceY / distance * shadowDistance + lightY - logoShdwCenterY) + "px";

	// finaly using the results of all above calculations to position our shadow and set the opacity
	logoshadow.css({ "left": shadowPosLeft, "top": shadowPosTop, "opacity": setOpacity(shadowDistance) });

}

This may looks a little bit weird and strange to you on the first sight, but it’s really not so difficult to understand and I used only some basic math formula for the calculations which I will describe you now.

Let’s get through it, line by line again:

  1. lightX: Getting the current X position of our light bulb
  2. lightY: Getting the current Y position of our light bulb
  3. logoX: Same like 1. only with the logo container
  4. logoY: Same like 2. only with the logo container
  5. distanceX: Calculating how far the logo is away from the light bulb on the X-axis
  6. distanceY: Calculating how far the logo is away from the light bulb on the Y-axis
  7. distance: Calculating the square root of distanceX and distanceY using the Math.sqrt(); function and for the two values the Math.pow(); function, which stands for exponential power. The first parameter, in our case distanceX or distanceY is the parameter for the base and the second parameter stands for the power. For making it clear: On the paper you would write: distanceX² and distanceY²
  8. shadowDistance: Multiplying the actual distance with the offset we defined at the top of our script where the variables are defined. We used this variable on click function of the light switch. So if you changed “shadowDistance” to “1”, you can now change it back to this variable.
  9. shadowPosLeft: Making the left offset of the shadow ready, to use it in our last line.
  10. shadowPosTop: Making the top offset of the shadow ready, to use it in our last line.
  11. logoshadow.css(): finally we are changing the CSS of our shadow container so it gets correct positioned and has the proper opacity

That’s it!

The last thing you need to do is to uncomment the moveShadow(); function twice (only if you have commented it out). At first at the variables section and at last in the jQuery UI’s draggable function.

Your shadow is now dynamic positioned and also has a cool looking dynamic opacity, depending on the distance and position of both: The light bulb and the logo.

I hope you liked this tutorial and could follow it step by step. If you’ve done everything correctly, you should have ended up with something like this: DEMO.

If you had some troubles with any step or need further instructions or help, feel free to write your question into the comments section of this post so I can take a look at your question and help you out!

Thanks for reading and have fun trying and using it in your next project!

Originally posted here:
How to Create a Nifty Dynamic Shadow with jQuery

Remains of the Day: Why DRM Doesn’t Work Edition [For What It's Worth]

Friday, March 5th, 2010

Designer Brad Colbow details how to download an audio book from the Cleveland Public Library (or why DRM doesn’t work), YouTube adds closed captioning to all videos, and a Google employee predicts that “in three years time desktops will be irrelevant.”

(Click the image above for a closer look.)






Read more:
Remains of the Day: Why DRM Doesn’t Work Edition [For What It's Worth]

jQuery 1.4 Reference Guide – Free Book Giveaway, Comment to win

Thursday, March 4th, 2010

For this months book giveaway we have jQuery 1.4 Reference Guide, written by Jonathan Chaffer, Karl Swedberg.
To give yourself a chance of winning this book all you have to do is leave a comment below, and tell us how jQuery has helped you improve your web development projects, or you could quite easily comment about how much you would love this book.

About the Book “jQuery 1.3 with PHP”

jQuery 1.4 Reference GuideTo make optimal use of jQuery, it’s good to keep in mind the breadth of capabilities it provides. So, if you are looking for a comprehensive reference guide to this popular JavaScript library, this book is for you.

The book has been revised and updated for version 1.4 of jQuery, and it offers an organized menu of every jQuery method, function, and selector. Each method and function is introduced with a summary of its syntax and a list of its parameters and return value, followed by a discussion, with examples where applicable, to assist in getting the most out of jQuery and avoiding the pitfalls commonly associated with JavaScript and other client-side languages.

In this book you will be provided information about the latest features of jQuery that include Sizzle Selector, Native event delegation, Event triggering, DOM manipulation, and many more. You won’t be confined to built-in functionality, you’ll be able to examine jQuery’s plug-in architecture and they discuss both how to use plug-ins and how to write your own.

What you can learn from this book
  • * Explore the impressive jQuery JavaScript library and its capabilities with a real-world example.
  • * Investigate jQuery’s plug-in architecture, using a variety of approaches to extend the library’s capabilities.
  • * Pull information from the server without refreshing a page using the AJAX capabilities of jQuery.
  • * Build a small script that dynamically extracts the headings from an HTML document and assembles them into a table of contents for the page.
  • * Discover the Form plug-in for combining AJAX techniques with HTML forms.
  • * Explore the Dimensions plug-in for getting the size and position of any element on the page—even the document and browser window.
  • * Determine whether an element is visible by testing its current width and height using a :visible selector.
  • * Inspect the browser environment and individual jQuery objects using the properties of jQuery.
  • * Create an extremely powerful jQuery toolset using a combined set of a selector expression and a corresponding DOM traversal method.
  • * Get complete and functional jQuery-powered scripts in this example-packed book.

Even if you don’t win the book, it is a book you should consider: jQuery 1.4 Reference Guide.

How to win this book

To give yourself a chance of winning this book all you have to do is leave a comment below, and tell us how jQuery has helped you improve your web development projects, or you could comment about how much you would love this book. The winner will be chosen at random.

Good luck to everyone!

You might also like…

15 jQuery Plugins for Better Web Page Element Layouts »
25 Useful jQuery Tooltip Plugins and Tutorials »
20 Professional jQuery Image Gallery Plugins »
25 Tutorials and Resources for Learning jQuery UI »
10 Useful jQuery Form Validation Techniques and Tutorials »



See the original post:
jQuery 1.4 Reference Guide – Free Book Giveaway, Comment to win

Email Blog Updates To Your Wordpress Blog With Postie

Thursday, March 4th, 2010

Recently, I covered how to create blog entries using just your voice through the magic of Google Voice. If you haven’t noticed yet, I love blogging. The concept of blogging just by making a quick phone call and speaking your blog entry is an idea that enters a little bit into the range of science fiction.

Unfortunately, as you may have noticed if you read that article, Google Voice doesn’t do a perfect job transcribing your voice yet. It completely misunderstands some words, and these mistakes are unacceptable when you’re using the text as a blog entry. So until Google can improve their service, we’re left with the next best option – email blog updates via email.


In the Google Voice article, part of the process of setting up the voice-to-blog system was installing a very cool Wordpress extension called Postie. I didn’t cover Postie in much detail, because you only need the basic email-to-blog feature to make that system work. However, using the additional features that Postie offers, in addition to letting you email blog updates, it will allow you to also send in photos and media, and create much more creative and interesting posts via email. So I thought I’d take some time to cover the extensive features of this excellent Wordpress extension.

Installing Postie On Your Blog

Most folks who have had a personal hosted Wordpress blog for a while understand how to quickly install or uninstall Wordpress plugins. If you’re not sure how to do it, simply download the zipped file from the Postie link above, unzip it to a folder on your PC, and then use your favorite FTP client to FTP the file into the plugins folder of your blog.

email blog updates

Once you do this, the plugin will show up as Postie and Cronless Postie in your Wordpress control panel under “Plugins.”

email blog updates

Activate both Postie and Cronless Postie. If you are a Linux user, or you otherwise know how to configure cron jobs that will run the Postie script every so often to check your email account for any new email, you can use just the Postie feature alone. However, for most users, the additional add-on Cronless Postie is needed so that you can use the built-in scheduler that will run the Postie script at a set interval (every day, hour, etc) to check for new emails.

How Postie Works

The cool thing about Postie, as opposed to most other email-to-blog tools out there, is that you can use any personal email account that you want – not a specific pre-defined address, as you have to do in some cases with Blogger. Once you’ve enabled Postie, go under “Settings” in your control panel and click on “Postie.” Here, you’ll see the basic Mailserver settings.

email blog updates

This is where you can set up your POP3 settings for any email that you like. I suggest setting up a Gmail account exclusively for receiving email blog updates. While any email will work (because you can filter out which senders are authorized to blog), creating an email account only for your blogging will make things a lot easier to handle.

email blog posts

User settings is where you define who can post to your blog via email. Do not “allow anyone” unless you feel pretty certain that the unique email you set up for your blog will not receive any spam or unexpected messages. By allowing anyone, you’re saying that anything that lands in the inbox of that unique email account will immediately be blogged – that could be dangerous. Instead, add Authorized Addresses in the list box.

When Postie checks your unique email account, it will check the sender. If the sender is one of those addresses, the email will get converted into a post entry. You can also automatically add the addresses of anyone set up on your blog under any role by simply selecting that role.

email blog posts

Once Postie checks your email account and recognizes a new incoming email from one of your authorized senders, you can then configure how the email is converted into a blog post under the “Message” configuration. Set up the default category that Postie blogs to, and if there’s no subject for the email (which normally becomes the title), then define a default title as well.

The options below that define how the message is processed – what code is allowed or not allowed. For example, if you allow the subject in the email, then people can type “#your title here#” in the message rather than the subject line in order to set the Title (this works well for SMS to email posts).

The coolest option here is the Tag or Message Start and End. Using this setting, you can define what text or code begins and starts the post, so no matter what extra text exists outside of those tags, only the enclosed text gets posted.

email blog posts

Unlike many other email-to-blog services, Postie gives you the ability to completely customize how many images attached to the email message are posted to the blog. I always had the problem, with previous apps that I’ve used, where the image would just get thrown at the top of the blog post and centered, with the text below it. I always like my images aligned as thumbnail left. Postie not only lets you set that up, but then you can further customize the image template by tweaking the HTML however you like.

The same customization is available for any video or audio files that you attach as well. Customize how those files are embedded into your blog, based on attached file type.

For any attached files of other types, you can define how that attachment looks in your blog. Select the icon set color and size, and add any default text that you’d like to go with it.

As you can see, Postie turns the ability to simply email blog updates into the ability to create full-featured blog entries via email. Now, when you’re on vacation and nowhere near a computer, you can just type up a quick email on your mobile phone, attach an image, and all of the customization that you have in place with Postie will ensure that your blog entry looks exactly as it does when you post it directly into the Wordpress editor.

Do you use Postie to post blog entries? What’s your favorite email-to-blog Wordpress plugin? Share your thoughts in the comments section below.

Did you like the post? Please do share your thoughts in the comments section!


Related posts



View original post here:
Email Blog Updates To Your Wordpress Blog With Postie