Sunday, May 15, 2011

Hide table row with javascript

Learn how to dynamically hide table row with a help of javascript! In this tutorial there are two samples:

  • How to hide or show entire HTML table on the fly

  • How to hide or show row in HTML table

To find more helpful javascript effect tutorials follow the link.

Hide HTML table on the fly with javascript

Demo:

show/hide Table
Simple table Row 1 Column2
Row 2 Column1 Row 2 Column2

With a clik on link "show/hide Table" entire HTML table is hided or showed. When a link is clicked jscript function elementHideShow with parameter simpleTable which is id of table. Then function elementHideShow hide table if table is showed (display property is block) or show table if table is hided (display property of table is none and become block).

Here is a sample code:


<script language="javascript">
    function elementHideShow(elementToHideOrShow) 
    {
        var el = document.getElementById(elementToHideOrShow);
        if (el.style.display == "block") {

            el.style.display = "none";
        }
        else 
        {
            el.style.display = "block";
        }
    }         
</script>

    <a href="javascript:elementHideShow('simpleTable');">show/hide Table</a>
    
    <table style="width:300px; display:block;" id="simpleTable" border="1">
        <tr>
            <td>
                Simple table</td>
            <td>
                Row 1 Column2</td>

        </tr>
        <tr>
            <td>
                Row 2 Column1</td>
            <td>
                Row 2 Column2</td>

        </tr>      
    </table>

Hide table row with javascipt

Demo:

show/hide Row
Simple table Row 1 Column2
Row 2 Column1 Row 2 Column2

In this case only table row is hided when a link "show/hide Row" is clicked. When use click this link a function elementHideShow is called with a parameter Row2Column1. This parameter is id of row in a table so entire row in HTML is hided (or showed if a row is already hided).

Here is a code:


<script language="javascript">
    function elementHideShow(elementToHideOrShow) 
    {
        var el = document.getElementById(elementToHideOrShow);
        if (el.style.display == "block") {

            el.style.display = "none";
        }
        else 
        {
            el.style.display = "block";
        }
    }         
</script>

    <a href="javascript:elementHideShow('Row2Column1');">show/hide Row 2</a>
    
    <table border="1">
        <tr style="width:300px; display:block;">
            <td style="width:50%" >
                Simple table</td>
            <td>
                Row 1 Column2</td>
        </tr>
        <tr id="Row2Column1" style="width:300px; display:block;">
            <td style="width:50%">
                Row 2 Column1</td>
            <td>
                Row 2 Column2</td>
        </tr>      
    </table>

Monday, May 9, 2011

Give New Heights To Your Web Designing Creativity – Useful Guide For Web Designers

Are you looking for some superb designs or just an inspiration to work on your own design? In this article you will come to know some best creativity works to serve as fuel for your website. In this collection you will come across some excellent work regarding logo designing, web designing, and some useful designing tips. These collections are from different galleries and also the best available over World Wide Web. Have a look and fine one best inspiration for your web designing effort.




Carbon Made Design Stock

This website is an excellent stock for web designers with its more than 174,00 master pieces specifically carrying web designing, and 3D animation background. You will get better insight after visiting this website.







Lemon Flip

This website is carries Slovakian collection of web designing to inspire designers who are involved in making posters, printed material, website designs, and logos.









CSS Mania

This gallery is more inspirational compared to previous one of CSS. This Drive equips designers with amazing color schemes along with a hover box. Designers can also get useful tips and tools for working in CSS environment.









CSS Elite

This gallery also contains CSS work. Designers can explore through different designs in accordance with their own preferences. They will get a variety of designs carrying features of
  • • Uniqueness
  • • Colorfulness
  • • Dark layouts
  • • Clean clutter free
  • • For blogging websites



Minimalsites

This again is a CSS gallery of designs. These designs are excellent for designers who want to make simple websites with minimal use of CSS.












CSS Remix

Designers will find this website great while looking for best designs obtained after mixing different designs and them reaching the one they were dreaming.










Link Crème

This website has earned a good repute among others providing good websites portfolio. Here designers can find web design made by using Flash technology or CSS.










Design Snack

Here at this website, users categorize web designs of their choice. Therefore, this site provides good collection of best designs as preferred by users. Designers are provided with facility of sorting out web design depending on Flash, HTML, CSS, or by the design category they are looking for like they want to work for music website or for some charity based websites.






Logo Pond

This website provides superb logo designs made by professionally expert web designs. These designs are provided by users that may inspire you if you are looking for something unique.










Logo Sauce

This is another website that displays logo designs. Here the amazing thing is the competition held for users who come up with unique logo designs. There is also prize money for the winner of competition that has a minimal worth of $200. Competitions are held under strict control of site editors.










Logo Design Love

This website carries lots of logo designs to inspire designers for their own work. This website will actually increase your love for logo designing.














Get inspiration from these websites and give a new direction to your creative skills. Your clients will really love your work.


Thursday, May 5, 2011

SEO Advice: Effective Site Structure & Content Building

In this article, we discuss two basic issues that effect many websites around the world; website structure and content building.

With more websites on the planet than ever before, finding the right website structure and having an appropriate architecture is paramount to a websites continual success. While it may seem like a common sense issue to have an easy navigation system and good interlinking in a website, many webmasters unfortunately fail to hit the target and although create beautifully well designed websites; these websites can be hard to navigate and hard to serve their given purpose

From Boutique (template) websites to large online databases and commerce sites, having an effective structure and navigation system is imperative.

In the case of small template websites (Boutique Sites) they are typically designed for displaying a companies business details and their core services. Simple in design and functionality, the idea is to direct users to a contact form, subscription page or services listed page by the company straight away.

The focus is on providing a direct targeted approach for the user, in terms of what they are looking to obtain. Each user should be able to find out exactly what there are searching for within one or two clicks.

As most website visitors browse a website homepage quite quickly, there should to be an immediate USP for them to dig deeper into your website. Generally, users will want to find information quickly and clearly without being confused by irrelevant distractions.

When a website visitor has progressed from the homepage, they need to be led to the next page that will either interest them or lead towards a point of action. If there is no such structure or focus, the chances are that the visitor will leave the website shortly after a couple of page views.

    Overall, the following tips are recommended for small business websites:

  • Ensure that the website is fresh and simple
  • Use a standardised set of colours
  • Keep the overall style and font standardised
  • Try not to over complicate the site with too many graphics

Adding Extra Content to Websites

In general terms of SEO, with one of the core principles being that “content is King,” an average rule of thumb would indicate that the more relevant content you have on your site and the greater number of relevant pages indexed would therefore lead to a greater web presence.

Given the nature of which each company website is made, there are certain limitations to the choice of pages created, the topics / themes of discussion and the amount of content that can be made.

For new and developing websites, it is wise to consider how you could develop your website to x3 its current size. If you have plenty of content, design ideas on hand then you are heading in the right direction. If you are struggling with ways to increase your website size you should re-consider your site structure and its associated content and navigation system.

One simple tip if you are struggling with the current amount of space on your site is to set up sub categories, folders and sub domains as this will allow you as a webmaster to create more defined, targeted content pages to attract particular niches to your website.

    5 easy website content building techniques

  • Set up a blog
  • Have testimonials / Reviews section
  • Case studies / Application Stories
  • Online Newsletter
  • Online Press Releases

Overall, in terms of content building and effective website structure, the core principle of keeping user interest and leading users to a point of action should always be a priority.

By-line: Stephen McAllister is the Marketing Manager at More Control Ltd who specialise in bespoke Automation Solutions and Automation products.


Monday, May 2, 2011

A Writer's Guide to Formatting Blog Posts

Guest post by: Tavis J. Hampton

There is a certain art to writing for the web, and anyone who does it has developed a skill that took time to learn. From mastering search engine optimization (SEO) to understanding image copyright restrictions, one could probably develop an entire course on web writing. Formatting is unfortunately one that sometimes gets overlooked. How you format your blog posts or online articles can affect everything else: SEO, presentation, clarity, and ultimately your reputation as a professional.

The good news is that it is far easier to format web articles now than it was five, ten, or even fifteen years ago. With dynamic websites and content management systems, publishing is a cinch, but there are still possible hiccups along the way that can cost you. This quick guide should help you learn or remember some of the more critical aspects of web formatting.

1. Avoid the direct Microsoft Word copy and paste. If you must use something like Word, turn off your blog's WYSIWYG editor (select HTML in WordPress), and paste directly into the plain text box. Then, switch back to rich text and format the document. Pasting from Google Docs is also much cleaner than pasting from Word, but it does put a DIV tag around the text and also does not preserve bold and italics in the paste, meaning you will still need to do some formatting within your blog's backend.

2. Use an HTML Editor. A simple way to ensure you provide the clearest, unmolested text to your readers is to use an HTML editor from the beginning. Wordpress and other content management systems tend to use XHTML 1.0 or higher for formatting. That means that old HTML 4.0 editors will use deprecated tags for line breaks, images, and other tags. You can avoid this by using an HTML editor like Amaya. As HTML 5 becomes more prevalent, blogging tools may soon adapt.

3. Avoid inline styles and extra code. This point relates to the previous two. Many word processors can format HTML, but they often leave inline styles within paragraph and span tags. First of all, these make the document unnecessarily long, and secondly, they cause problems when you try to edit them within the content management system. If you absolutely cannot use an HTML editor before pasting text into your blog, paste plain text and do all of your formatting within the blog's editor.

4. Include alt attributes for images. For both SEO and accessibility, alt attributes in image tags are important. They describe images to non-visual browsers, both search engines and visually impaired humans. Wordpress and other blogging software include title and alternate text entries. Make them clear and descriptive but not too wordy.

5. Resize images to fit your blog. Some blogging systems will automatically resize to the dimensions you specify, but older systems may only set dimensions in HTML, leaving the actual file size larger than it should be. Furthermore, by resizing in your own image editing program, you can control the amount of compression and also tweak and crop the image. If you intend to show detailed screenshots, consider using thumbnails that will display larger versions of the images upon clicking.

6. Use CSS styles for frequent formatting. If you have a little knowledge of CSS, you can add styles that you know you will use frequently to your WordPress or other blogging CMS template. That way, whenever you need to apply a style, you can use a quick CSS class. many web hosts, such as dedicated hosting provider 34SP.com, will install WordPress for you, but you can still edit the theme's CSS file within the backend's theme editor.

7. Preview before posting. You may think your post is formatted correctly, but it is always better to double check to make sure it looks the way you expect. This is particularly important if you pasted from another editor. Wordpress, for example, removes some code and modifies others, which can sometimes lead to formatting problems.

Formatting your blog can often make or break your article. Text or images that are malformed or incorrectly displayed often turn readers off before they even start to read your work. No matter how good your writing skills are, it is the presentation and appearance that will make the first and often lasting impression.

Tavis J. Hampton is a seasoned writer with a decade of experience in IT, web publishing, and free and open source software. Some of his services include writing, web design, electronic publishing, and information management.


Sunday, May 1, 2011

Hide or show div element

Want to learn how to hide div element on your HTML page with javascript? Or how to dynamically show div element? You are on right place. Here you will find simple tutorial, demo and code how to toggle (hide or show) <div> element with its content. With help of javascript div visibility is dynamically changed.

More article and samples how to hide or show HTML element find on Show and hide with javascript summary.
If you are interested in some other fancy javascript effects follow the link.

Demo for hiding and showing div element:

SHOW/HIDE <-- press here




Here is the sample HTML and Javascript code:


<script language="javascript">
    function showOrHide() 
    {
        var div = document.getElementById("showOrHideDiv");
        if (div.style.display == "block") 
        {
            div.style.display = "none";
        }
        else 
        {
            div.style.display = "block";
        }
    } 
</script>
 
<a href="javascript:showOrHide();">show/hide</a>
<div id="showOrHideDiv" style="display: none"><h4>Hello</h4></div>



    What is happening in the code:

  • When user click SHOW/HIDE link javascript showOrHide() function is called

  • Method showOrHide() checks the value of the display style for the div showOrHideDiv

  • If the display style of div is none (div is not visible) function will set div style to block - so the div will become visible

  • If the display style of div is block (div is visible) function will set div style to none - so the div will be hidden

Demo for div element containing other HTML elements

The <div> tag is often used to group block-elements. You can put any HTML element inside div tag. In this example we put some text and two input HTML element. When user click link both textboxes are hided or showed.


SHOW/HIDE <-- press here


This is a code:

 
<script language="javascript">
    function showOrHide() 
    {
        var div = document.getElementById("showOrHideDiv");
        if (div.style.display == "block") 
        {
            div.style.display = "none";
        }
        else 
        {
            div.style.display = "block";
        }
    }

</script>
<br/>
<a href="javascript:showOrHide();"><b>SHOW/HIDE</b></a> <-- press here
<br/><br/>
<div id="showOrHideDiv" style="display: none">
First name: <input type="text" name="FirstName" value="Donald" /><br />
Last name: <input type="text" name="LastName" value="Duck" /><br />
</div>


Purpose of this example is to demonstrate that in div tag can be many various HTML elements. So, when you hide div tag you hide all HTML element this div tag is contain. Same thing count for showing div.

If you want to change text of your link to Show or Hide when div tag is showed or hided take a look at change link text with javascript.

Demo of one javascript function for hiding various div elements

show/hide Div A   show/hide Div B

Div A

 

Div B

 

Here is a code of reusable javascript function divHideShow for hide div elements. This function can be called from various places. The input parameter in function divHideShow is id of <div> tag you want to hide or show.


<script language="javascript">

    function divHideShow(divToHideOrShow) 
    {
        var div = document.getElementById(divToHideOrShow);
        if (div.style.display == "block") {
            div.style.display = "none";
        }
        else {
            div.style.display = "block";
        }
    }
    
</script>
 

    <table style="width: 28%; height: 54px;">
        <tr>
            <td>
                <a href="javascript:divHideShow('divA');">hide DivA</a>
                </td>
            <td>
                <a href="javascript:divHideShow('divB');">hide DivB</a></td>
        </tr>
        <tr>
            <td>
                <div id="divA" style="display: block"><h4>Div A</h4></div></td>
            <td>
                <div id="divB" style="display: block"><h4>Div B</h4></div></td>
        </tr>
    </table>

In above code example same jscript function divHideShow(divToHideOrShow) is called from show/hide Div A link and from show/hide Div B.

One more thing, if you need here you can find instructions how to place two div elements in one line side by side.