Site Temasını Kullanıcı İstediği Gibi Seçsin
2
●74
- 09-01-2023, 22:42:47
<html> <head> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> <!--download jquery.cookie from here http://plugins.jquery.com/cookie --> <script type="text/javascript" src="images/jquery.cookie.js"></script> <script type="text/javascript"> $(document).ready(function(){ var theme = $.cookie("backgroundImage"); if (theme){document.getElementById("shelf").style.backgroundImage = "url("+theme+")";} $("#themes").change(function() { theme = $(this).val(); $.cookie("backgroundImage", theme); document.getElementById("shelf").style.backgroundImage = "url("+theme+")"; }); }); </script> </head> <body id="shelf"> <!--<select id="themes" onChange="changeTheme()" name="ChangeBG">--> <select id="themes" name="ChangeBG"> <option value="images/background1.jpg" selected="selected">Default</option> <option value="images/background2.jpg">Heart</option> <option value="images/background3.jpg">Earthly</option> <option value="images/background4.jpg">Sunflowers</option> <option value="images/background5.jpg">Mountin</option> </select> </body> </html>Bu kodu düzenleyebilirsiniz hocam
kaynak: