Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to put jquery-cookie for function showHide(shID) do anyone know how to do that ? I got a onclick button to show more content , using function showHide(shID) but I just need to hide for once .So is it possible to add jquery-cookie for it ?how can I do that ? [https://github.com/carhartl/jquery-cookie#readme][1]
full code here:
http://jsfiddle.net/Garfrey/5xf72j4m/8/[^]
here my code:function showHide(shID)

XML
<script language="javascript" type="text/javascript">
function showHide(shID) {
   if (document.getElementById(shID)) {
      if (document.getElementById(shID+'-show').style.display != 'none') {
         document.getElementById(shID+'-show').style.display = 'none';
         document.getElementById(shID).style.display = 'block';
      }
      else {
         document.getElementById(shID+'-show').style.display = 'inline';
         document.getElementById(shID).style.display = 'none';
      }
   }
}
</script>


please , I need someone to guide me or let me know how to do that .Thanks in advance !
Posted
Updated 29-Jan-15 19:52pm
v3
Comments
Can you please explain more? What should happen when you click on "Read More"?
garfrey 30-Jan-15 7:21am    
Hi Tadit Dash ,thanks for your reply . Here my fiddle : http://jsfiddle.net/Garfrey/5xf72j4m/8/ Actually the "read more" button is hidden content , when user click it and display more content . So that I need to set cookie function to it , just for the user who visit back my page the hidden content is still showing .
-user click on read more button > show hidden content > user visit back my page > the hidden content still showing .
I really need help ,wish to get back your reply .thanks
Solai Raja 16-Feb-15 4:52am    
When you have click on the "Read More" Button set some cookies in to browser, when the user visits your page second time, get the same cookie you have stored (on document.load or $(document).ready(function(){});). and call you showHide(cookieValue) function.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900