BigBangThinking Posted October 27, 2023 Posted October 27, 2023 (edited) Hola Has anyone achieved to have a random image as a logo? My logo has multiple versions and would love to have a random one on every page open. I have done it in the past in Wordpress. Any idea how? http://www.symbioticdesignacademy.com Edited October 27, 2023 by BigBangThinking Added link
tuanphan Posted October 29, 2023 Posted October 29, 2023 You mean this logo? Change to another logo when users load the page Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
BigBangThinking Posted October 30, 2023 Author Posted October 30, 2023 Hi @tuanphan, yes that logo. I've been told to do so in java but not sure how.
tuanphan Posted November 3, 2023 Posted November 3, 2023 (edited) Try adding this code to Website > Website Tools (under Not Linked) > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> var image = new Array (); image[0] = "https://cdn.pixabay.com/photo/2023/10/27/12/13/vineyard-8345243_1280.jpg"; image[1] = "https://cdn.pixabay.com/photo/2023/10/28/18/02/songbird-8348139_1280.png"; image[2] = "https://cdn.pixabay.com/photo/2023/10/21/18/47/boat-8332114_1280.jpg"; image[3] = "https://cdn.pixabay.com/photo/2023/10/20/14/52/glacier-8329668_1280.jpg"; var size = image.length var x = Math.floor(size*Math.random()) $('header#header img').attr('src',image[x]); </script> I got code from Codepen: https://codepen.io/fredthewebguy/pen/yvWddw Edited November 3, 2023 by tuanphan Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
tuanphan Posted November 6, 2023 Posted November 6, 2023 Can you keep the code? We can check it easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
dfesenmyer Posted November 14 Posted November 14 Has this been solved? I'd love to know how to do it?
tuanphan Posted November 15 Posted November 15 15 hours ago, dfesenmyer said: Has this been solved? I'd love to know how to do it? You try use above code, if it still doesn't work, please share site url Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment