我正在做一个网站,由不那么科技精明的人来维护,我需要能够给他们添加使用jquery向上/向下滑动以显示其内容的“see-more”锚点的能力。如何在html中创建只需要锚点的see-more/Read-more功能?
我的代码适用于读取更多的单个实例,但是当存在多个此实例时,它会相当麻烦。
使用Javascript/jQuery的
$(".see-more").nextUntil(".see-less").wrapAll("
$(".see-less").hide();
var count= 1
/*
$(".see-more-content").each(function(){
var count= count+1;
$(this).data("count",count);
console.log(count);
});
*/
$(".see-more-content").slideUp(0);
$(".see-more").click(function(){
$(".see-more-content").slideToggle();
$(".see-more").hide();
$(".see-less").show();
});
$(".see-less").click(function(){
$(".see-more-content").slideToggle();
$(".see-less").hide();
$(".see-more").show();
});
HTML
- Advanced Elastic search Technology
- Document Text Search
- Embed Code Web Publishing for Images, Video & PDFs
- Video Management with HTML5 Full
- Previews On the Fly Conversions and Transcoding
- Print on Demand
- Stylized Collections (Lightboxes/Galleries)
- Alerts and Notifications
- Comments, Ratings and Favorites
- WordPress and Drupal CMS Integrations
- Dropbox Integration
- Asset Level Performance Analytics • Site Activity Analytics Dashboard
- Unlimited Custom User Access Levels
- Integrated Content Contribution and Workflow
- Personal Profile Management
- Mobile App and Site
- Watermarking
- Rights Management
- All New Feature Releases3