Erchima Gaming Forums

Hack the game and enjoy playing it!


You are not connected. Please login or register


[jQuery] Show() Hide() dan Toggle  

 

#1Almaftuchin

[jQuery] Show() Hide() dan Toggle Empty7th May 2014, 2:43 pm

Almaftuchin

Administrator
[jQuery] Show() Hide() dan Toggle GTrNrDD

Sebelum pakde menggunakan script ini, website pakde wajib sudah tertanam Framework jQuery
jika belum tertanam silahkan tanam dahulu dengan cara:

  1. Copy jQuery dibawah ini
    Code:
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js' type='text/javascript'/>

  2. Cari kode </head>
  3. Lalu pastekan kode tepat diatas kode </head>
  4. Simpan


Javascript:
Code:
$('.erc-show-hide').toggle(function() {
    $(this).text('Show');
    $('#target').slideUp();
}, function() {
    $(this).text('Hide');
    $('#target').slideDown();
});

CSS:
Code:
.erc-show-hide {
    background:#56af2e;
    color:white;
    text-align:center;
    padding:8px 12px;
    font-family:Tahoma, Verdana;
    font-size:13px;
    border-radius:5px;
    cursor:pointer;
}

#target {
  background:#1f57a3;
  height:150px;
  margin-top:15px;
    display:none;
}

Penulisan penggunaan HTML:
Code:
<span class="erc-show-hide">Show</span>
<div id="target" style="display: none;">www.erchima.net</div>

Demo:
<a href="http://www.erchima.net/h10-demo-jquery-toggle-show-hide" target="blank"><button>Demo JQuery () Show Hide</button></a>

Selamat mencoba

Credit: [You must be registered and logged in to see this link.]

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum