JS Cookie hide/show div

后端 未结 1 1331
日久生厌
日久生厌 2021-01-06 23:38

Trying to make a jQuery cookie hide/show box using JS Cookie, but I somehow can\'t make it work. The box won\'t display at all. I\'m using Shopify.

#pop-up         


        
1条回答
  •  我在风中等你
    2021-01-07 00:19

    It does not work because you can only store strings in cookies. You store the string "true" instead of the boolean value true.

    Try the following code where I replaced the check with != "true".

    
    

    A working jsfiddle: http://jsfiddle.net/bqam0qb4/1/

    0 讨论(0)
提交回复
热议问题