website design

directions

Use Mod Rewrite to append www to URLs

0


This is how to add www to the start of all your URLs in your website.
Simply edit your .htaccess file…


# Redirect adding leading www to root domain if not subdomain specified
RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

You can also add a trailing slash to URL’s to increase performance. When a trailing slash is added to the end of a URL that does not end in a file extension, it tells the server to look only for that directory name.

rewriteCond $1 !/$
rewriteCond %{REQUEST_FILENAME}/ -d
rewriteRule (.+) http://www.domain.com/$1/ [R=301,L]

tabs

JQuery-Tools: Tabs – problems using the apple-overlay effect inside a pane

2


Had beginners problems using the JQuery-Tools tabs tool because every time I tried to put divs inside the tabs panes, (divs containing anything other than text), I found the content of the panes would not display in the tab. After trying to reference a separate file and an iframe I found the apple-overlay effect worked but wasn’t displaying in the centre of the screen. I found this answer after trying: nested tabs, adding a wrapper class to the pane divs. Both these solutions didn’t work then I found to use the apple-overlay inside a tab, I needed to use the ajax-tabs set up rather than the basic set-up for tabs and this fix in my css to sort the display issue ….think it’s called a child selector….

Rather than…

div.panes div { display:none; etc… } for the pane styling, use

div.panes > div { display:none; etc… }

and the display:none issue with divs inside tabs panes will only apply to the first div in a pane.

Spoon Apps Library : run IE7 in Windows 7 in the browser

0

Spoon run all the browsers in 1 browser
I recently had problems with internet explorer not displaying images correctly and had to cross-browser test and correct a website that was playing up in IE7. Having recently installed Windows 7 on all my machines (and being an advocate of Chrome) I found that IE7 was not readily available for Windows 7. I found this site spoon.net that lets you run a browser sandbox for hundreds of apps including Internet Explorer 7 and have used it to mess about with all the old browsers. I’ve also found it handy for discovering new apps as well. Defiantly deserves a place on the bookmark bar… next to differencebetween.net

Create a URL button in flash AS3

0

If you need a banner to have a button that when clicked takes you to another webpage when you click the flash button this is how you do it. You need to create a button (in this case a transparent rectangle on top of a web banner animation), add an event listener(a mouse event/click) and create a function (in this case the function is to request a URL and navigate to it).

1/ Press F8 to convert a rectangle into a symbol, create button and name it myButton.
2/ Click on the button in the main timeline and press F9 to open the actions window.
3/ Use this code to create an event listener and a function for after the click event.
You can use…
“_blank” or “top” to open in a new tab
“_parent” or “_self” open in the same tab


myButton.addEventListener(MouseEvent.CLICK, myButtonFunction);
function myButtonFunction(event: MouseEvent) {
var request:URLRequest = new URLRequest("http://www.pmlmedia.co.uk");
navigateToURL(request, "_self");
}

map

Add a Google Map into your web page

0

1/ Use Google maps to find the longitude and latitude of the address you want to map – when the map pin is in the middle of the screen, paste this code into your browser…

javascript: void(prompt('',gApplication.getMap().getCenter()));

2/ generate a google maps API key. If you’ve got more than one map in your site, don’t just genereate a key for your domain name, use the full location of the directory e.g. pmlmedia.co.uk/testwebsites/newsite1/

3/ Edit this code with your newly generated API key, longitude and lattitude, and address (for when someone clicks on your map pin) then paste the edited code into the head of your webpage.

<script src="http://maps.google.com/maps?file=api&v=2&key=REPLACETHISTEXTWITHYOURAPIKEY&sensor=true" type="text/javascript"></script> <script type="text/javascript">// <![CDATA[
/* <![CDATA[ */

    function initialize() {
        if (GBrowserIsCompatible()) {

            var a = REPLACETHISTEXTWITHYOURLONGITUDE;
            var b = REPLACETHISTEXTWITHYOURLATITIDE;
            var zoom = 16;
            var html = '

<div class="htmlwindow">
REPLACEWITHNAMEOFBUSINESS
REPLACEWITH1STLINEOFADDRESS
REPLACEWITH2NDLINEOFADDRESS<'+'/div>';

            var map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng((a+0.001), b), zoom);
			map.addControl(new GSmallMapControl());
			//map.addControl(new GMapTypeControl());
 			map.enableScrollWheelZoom();

            var marker = new GMarker(new GLatLng(a, b));
            GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
            map.addOverlay(marker);
            //GEvent.trigger(marker, "click");
        }
    }
    /*  */
// ]]></script>

4/ Paste these event functions into your opening body tag…

<body onload="initialize()" onunload="GUnload()">

…and create a DIV wherever you want your map to appear and set the width and height for your map.

 <div id="map_canvas" style="width: 529px; height: 300px"></div>
Go to Top