1
I am creating a button to open the chat on one of my sites. I am currently using Zopim.
To open the chat, the link is used:
<a href="javascript:void($zopim.livechat.window.show())">ABRIR CHAT</a>
To close the chat, the link is used:
<a href="javascript:void($zopim.livechat.window.hide())">FECHAR CHAT</a>
I need you to when the person click to Abrir o Chat
, automatically switch the link to Fechar o Chat
and that when the person clicks on Fechar o Chat
change to Abrir o Chat
.
That is, it is alternating, when you click on one the link changes to the other.
So with the same button I can open and close the chat.
There is no way to be only 1 link no? Because it is 1 button, the same would have to open and close. :(
– Alexandre Lopes
No jsFiddle: http://jsfiddle.net/AlexandreBR/g8r7wveo/1/
– Alexandre Lopes
Example: http://iweb.com/dedicated-server. when you click on
LIVE CHAT
in the lower right corner, it opens and closes their chat.– Alexandre Lopes
I didn’t even see you edit the answer! hehe! It’s getting pretty good, only there’s a problem: When you click OPEN CHAT, it changes the text to CLOSE CHAT, but if you click CLOSE CHAT, it doesn’t change the text back.
– Alexandre Lopes
http://jsfiddle.net/AlexandreBR/g8r7wveo/2/
– Alexandre Lopes
Open your browser console and see the error. Zopim needs to be loaded (whatever it is).
– bfavaretto
Yes! True, now it’s 100%! Right answer!
– Alexandre Lopes
It was 100% Vlw, it was even better because the link is
href="#"
there is no link Zopim.– Alexandre Lopes
It’s just that I hadn’t touched that I needed the Zopim working. I put it in jsFiddle and it wasn’t working. Rsrsrs
– Alexandre Lopes
if it wasn’t too much to ask, could you quote another example? Like, instead of opening and closing the chat, a
margin-top:20px;
when I clicked.– Alexandre Lopes
@Alexandrelopes There’s another question... Check out http://api.jquery.com/css/#css2
– bfavaretto
I’m going to ask another question then. There’s no risk of my question being duplicated, right? I wanted when I clicked on the link
<a>
were given amargin-top:20px;
indiv
containing the class.zopim
– Alexandre Lopes
Pronto @bfavaretto http://answall.com/questions/28634/comorcriar-um-link-que-ao-clicado-muda-%C3%A9-added-a-property-css-in-u
– Alexandre Lopes