123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>


<ul>
  <li><a href="#">Home</a></li>
  <li><a href="#">Portal</a></li>
  <li><a href="#">Game</a></li>
  <li><a href="#">Design</a></li>
  
 <!-- SON MENÜNÜN KODLARI-->
<li onclick="myFunction()" class="dropbtn"><a href="#" data-backdrop="static" data-keyboard="false">Background
  <div id="myDropdown" class="dropdown-content" data-backdrop="static" data-keyboard="false">
    
<img src="https://wallpapersite.com/images/wallpapers/sunset-1920x1080-forest-minimal-4k-8k-5165.jpg" width="250px"class="1">

<img src="http://www.qygjxz.com/data/out/80/4239912-flat-wallpaper.png" width="250px" class="2">

<img src="https://i.pinimg.com/originals/d6/f0/13/d6f0130ff38d7d197f7be368dd98c034.png" width="250px" class="3">

  </div>
  </li>
  
  
  
  
</ul>
            
          
!
            
              ul{
  font-family: Arial;
  margin:0;
  padding:0;
  background:#222;
  list-style-type:none;
  position:relative;
}


li{
  display:inline-block;
  color:white;
}

li a{
  color:white;
  display:block;
  padding:15px;
  transition:all .3s;
  text-decoration:none;
}


li a:hover{
  background:green;
  transition:all .3s;
}


.dropdown-content {
    display: none;
    position:absolute;
    width:calc(250px * 3 + 10px);
    top:50px;
    left:0;
    padding:0px;
    background:#f1f1f1;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}

.show {display: block;}

.fondo1 {
	background: url(https://wallpapersite.com/images/wallpapers/sunset-1920x1080-forest-minimal-4k-8k-5165.jpg) repeat fixed -2px -148px;
}

.fondo2 {
	background: url(http://www.qygjxz.com/data/out/80/4239912-flat-wallpaper.png) repeat fixed -2px -100px;
}

.fondo3 {
	background: url(https://i.pinimg.com/originals/d6/f0/13/d6f0130ff38d7d197f7be368dd98c034.png) repeat fixed -2px -380px transparent;
}
            
          
!
            
              function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}

 
jQuery.noConflict();
jQuery(function($) {
	$(".1").click( function(){ $
		("body").removeClass('fondo2 , fondo3').addClass("fondo1");
                $.cookie("BGCHANGER","fondo1", {expires: 365});
                return false;
	});

	$(".2").click( function(){ $
		("body").removeClass("fondo1 , fondo3").addClass("fondo2");
                $.cookie("BGCHANGER","fondo2", {expires: 365});
                return false;
	});

	$(".3").click( function(){ $
		("body").removeClass("fondo1 , fondo2").addClass("fondo3");
                $.cookie("BGCHANGER","fondo3", {expires: 365});
                return false;
	});
});









/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // NOTE Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console