¡@

Home 

2014/10/16 ¤W¤È 12:04:30

jquery Programming Glossary: item.match

jQuery text truncation (read more style)

http://stackoverflow.com/questions/2248742/jquery-text-truncation-read-more-style

for convenience lastTag lastOpenTags lastOpenTags.length 1 Store last opening tag in a variable for convenience if item.match ^ If 'item' is not a tag we have text if lastTag item.charAt 0 ' ' lastTag 1 .match span SPAN item item.substr 1 Remove.. nowHiding true Now we're hiding. continue Break out of this iteration. else Item wasn't text. It was a tag. if item.match br BR If it is a br tag ignore it. if item.match If it is not a closing tag... lastOpenTags.push item.match w s ^ .. out of this iteration. else Item wasn't text. It was a tag. if item.match br BR If it is a br tag ignore it. if item.match If it is not a closing tag... lastOpenTags.push item.match w s ^ Store it as the most recent open tag we've found. ..