want to design an effect that can switch between text list, picture list, detailed list and so on. I saw similar video tutorials on the Internet before, but now I can"t find them.
I use simple .click () click events addClass () and .removeClass () to delete or add classes. Two styles can barely be implemented, while three styles are stupid. I feel too repetitive and impractical!
related codes
/ / Please paste the code text below (do not replace the code with pictures)
$("- sharpFolder") .click (function () {
if(!$("-sharpwin-vod-list").hasClass("mdui-row-xs-9")){
$("-sharpwin-vod-list").addClass("mdui-row-xs-9").removeClass("mdui-row-xs-1");
$("-sharpwin-vod-list .list-video-thumb").removeClass("mdui-float-left");
$("-sharpwin-vod-list .text-normal").removeClass("mdui-float-left");
$("-sharpwin-vod-list .list-video-info").hide()};
});
$("- sharpdetailed") .click (function () {
if (! $("- sharpwin-vod-list"). HasClass ("mdui-row-xs-1")) {
$("-sharpwin-vod-list").addClass("mdui-row-xs-1").removeClass("mdui-row-xs-9");
$("-sharpwin-vod-list .list-video-thumb").addClass("mdui-float-left");
$("-sharpwin-vod-list .text-normal").addClass("mdui-float-left");
$("-sharpwin-vod-list .list-video-info").show()};
});
$("- sharppic_thumb") .click (function () {
});