0
有沒有辦法改變這個腳本作爲盲目效果。切換窗簾效果
// Andy Langton's show/hide/mini-accordion - updated 23/11/2009
// Latest version @ http://andylangton.co.uk/jquery-show-hide
// this tells jquery to run the function below once the DOM is ready
$(document).ready(function() {
// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='';
var hideText='';
// initialise the visibility check
var is_visible = false;
// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');
// hide all of the elements with a class of 'toggle'
$('.toggle').hide();
// capture clicks on the toggle links
$('a.toggleLink').click(function() {
// switch visibility
is_visible = !is_visible;
// toggle the display - uncomment the next line for a basic "accordion" style
//$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('slow');
// return false so any link destination is not followed
return false;
});
});
FYI-
Where it says:
var showText='';
var hideText='';
It was originally:
var showText='Show';
var hideText='Hide';
我刪除了顯示/隱藏文本,因爲我正在將鏈接應用到文本的不同區域。我喜歡Blind效果,而不是這種切換效果,並且如果可能的話,需要知道如何應用它。我無法找到一個基本的盲效應腳本,它允許使用將鏈接應用於任何文本,而不是使用按鈕或靜態文本。
謝謝!希望你能幫助! Tracy