I am new in this, I need 2 simple actions

Hi, a client asked me for 2 things that I confirmed cannot be done with normal Wix.

  1. Add a float description to a button when hovering over it (rollOver). It would be show a synthesis of the section to which direct, a preview. To add a short sentence or paragraph.

  2. Make a banner with phrases that change daily. It can be 1 day a year and / or randomly. I am talking about too many phrases. The idea is not to put a carrousel. Rather, they rotate automatically.

So you have a client who surely will pay you for your job and now you are looking for free to have solutions, hmm not bad, not bad! But hey! You are not the first one :wink:

But no problem, this time you will get your answer…

What you will need?
You have a BUTTTON and you want to show a text floating-up.

$w.onReady(()=>{
	$w('#myButtonElementIDhere').onMouseIn(()=>{
		$w('#myTextElementIDhere').show('float')
	});
	
	$w('#myButtonElementIDhere').onMouseOut(()=>{
		$w('#myTextElementIDhere').hide('float')
	});	
});

The rest of the first part i did not really understand from your description.

  1. To generate your banner you will need something like this example shows…

https://russian-dima.wixsite.com/meinewebsite/test-1

Of course your situation a a little bit different.

So if you want to make it 1x daily…

-you have first to save the state of [last changement-date] somewhere into a prepared DATABASE, so you can always compare if the current date of today has been already changed. If so → change phrase to another one, randomly or liniar.

Also you surely already will have prepared a DATABASE, where all your → “phrases” are stored in, so you can get them from DB.

By the way, to generate something in RANDOM-MODE…

https://russian-dima.wixsite.com/meinewebsite/random-numbers-strings

So you have now some ideas how to solve it → so you will do that surely within a short coding time, because these are just → 2 simple actions.

Good luck & happy coding!:wink:

Oh forgot to say! Working with DATABASES, you will surely also need this one…

To be found here…

As my fellow velo-Ninja suggested,
The float will be with a mouseover.

about the banner it is a special idea but not impossible.
Add a database with multiple phrases you want to show.
and add a column with true or false.

Then in the backend make a .jsw file there you can make a function that gets all the data from the database, removes where it is says true.
Then add on a random place true.

Then make a job. (jobs.config)
This file runs in the back end and does things for you.
Code in jobs.config looks like this
{
“jobs” : [
{
“functionLocation” : “/yourFile.jsw” ,
“functionName” : “functionName” ,
“executionConfig” : {
“cronExpression” : “56 * * * *”
}
}
]
}

The cronExpression is something special it tells you when to do the function.

This cron does it evry 56 minute of the hour
So 1:56 - 2:56 - 3:56

0 0 1 * * will do it evry thime at 0:00 evry first day of the month

Here is a website wher eyou can test it out.

Then when loading the page:
Loop trough the database and look where it says true, and get that phrase.
Since the true value will change evry X amount of time, your phrase will change.

Kind regards,
Kristof