im making an accordion for a client. there website is built on .net, something of which i have no idea how it works.
my current accordion is something similar too...
<h1>Header</h1>
<span class="content">Content here</span>
I need something more like
<h1>Header</h1>
<span class="entry-content">summary here</span>
<span class="content">Content here</span>
I w开发者_如何学编程ant the 'entry-content' to show initially and when the h1 is clicked the 'content' div slides down.
As its in .net all the content is pulled from the following line...
<%#Eval("Information")%>
is there a way with JS i can wrap the first 200 characters in a div, and the rest can be wrapped in another div?
I hope this makes sense!
I thinks this might do the trick http://jsfiddle.net/UX3sC/
Answer to the section javascript, wrap first 200 characters in a div
Dion Jones: you are already doing that with Circadians code, it will give you the HTML markup:
<h1>Header</h1>
<span class="entry-content">summary here</span>
<span class="content">Content here</span>
Or you want the markup to look any other way?
精彩评论