Streaming live at 10am (PST)

Implementation of a simple text rotator


#1

Hi
I try to implement a simple text rotator, the exact same one as the one you can see on the following link:
http://www.thepetedesign.com/demos/jquery_super_simple_text_rotator_demo.html
+ code available here:
https://github.com/peachananr/simple-text-rotator

I copied the code from github but rotation is not working, I have an error on row 435 saying textrotator is not a function. I don't know how to do.

My webflow example is available here:
http://test-0bf9e0.webflow.io/

Fyi: as I do not know where to store javascript and css file on webflow, I directly imported, in the header, the css code with <style></style> and the js code with <script></script>.

Could you please help?

Thanks!
Adrien


#2

It looks like webflow add the following row in the code under <body>:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js" type="text/javascript"></script>

This row is in conflict with jquery I use in <head>...

How to resolve this conflict?


#3

Okay I have found why:
It is because webflow add the jquery in the <body> so I have to move the following from <head> to <body> as well:
<script type="text/javascript" src="jquery.simple-text-rotator.js"></script>.

Why do you guys put some JS in the body?


#4

Hi @homie, thanks for posting in the Code Help page. I have created a simple example of the integration here:

https://webflow.com/website/Super-Simple-Text-Rotator

I have minified the .js and the .css and also pasted in the code, directly into the header and footer.

I hope this example helps! Cheers, Dave


#5

Thanks !

Now how can I insert it in the middle of my webflow website? Because it shows up at the end.

Here is the website:
http://homie-v2.webflow.io

I want to have it instead of the 4 hashtags rows.

How can I do?

Thanks,
Adrien


#6

@cyberdave I managed to do it thanks to your example. Thanks a lot Dave ! Topic closed.


#7