27 lut 2014

SVG animacja

Najpierw styl którym nadajemy kolor wykresów.

<style>
    rect {
        fill:red;
    }
</style>

Teraz umieszczamy svg w stronie.

<svg width="500px" height="300px">
    <g transform="scale(1, -1) translate(0, -300)">
        <rect x="0" y="0" height="30%" width="15%">
            <animate attributeName="height" from="0" to="30%" dur=".5s"></animate>
        </rect>
        <rect x="20%" y="0" height="10%" width="15%">
            <animate attributeName="height" from="0" to="10%" dur=".5s"></animate>
        </rect>
        <rect x="40%" y="0" height="20%" width="15%">
            <animate attributeName="height" from="0" to="20%" dur=".5s"></animate>
        </rect>
        <rect x="60%" y="0" height="70%" width="15%">
            <animate attributeName="height" from="0" to="70%" dur=".5s"></animate>
        </rect>
        <rect x="80%" y="0" height="40%" width="15%">
            <animate attributeName="height" from="0" to="40%" dur=".5s"></animate>
        </rect>

    </g>
</svg>
16 paź 2013

Dodanie czcionki googla do strony

<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lobster&subset=latin,cyrillic-ext,cyrillic' rel='stylesheet' type='text/css'>
<h2 style="font-family:Lobster,'Noto Sans',arial;">Nasz portal<br/>pomaga</h2>
27 mar 2012

Odczyt wartość pola option na podstawie selectedIndex

Odczyt wartość pola option na podstawie selectedIndex i wstawienie do pola hidden

<select name="stanowisko_sel" onchange="this.form.stanowisko.value = 
this.options[this.selectedIndex].text">
  <option value="1">Kierowca</option>
  <option value="1">Budowlaniec</option>
</select>
<input maxlength="50" name="stanowisko" size="50" type="hidden" />