Ich habe eine Fancybox, die sich beim Laden einer Seite öffnet. Alles funktioniert gut, außer ich bin nicht in der Lage, die Pop-up-Box zu gestalten. Es scheint, wie es nicht meine css abholen wird. By the way; Ich bin nicht vertraut mit js - Ich kopiere nur von Tutorials! Also, wenn die Antwort js enthält, bitte sehr spesific sein. Ich danke Ihnen!
Im Kopf:
<link rel="stylesheet" type="text/css" href="stackoverflow.com/js/jquery.fancybox/jquery.fancybox.css" media="screen" />
<link rel="stylesheet" href="stackoverflow.com/stylesheets/ups-screen.css" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.fancybox/jquery.fancybox-1.2.1.pack.js"></script>
<body onload="$(a'#popup').trigger('click');">
Direkt vor dem abschließenden Body-Tag:
<script type="text/javascript">
$(document).ready(function() {
$("#popup").fancybox().trigger('click');
});
Der zu ladende Inhalt:
<a id="popup" href="#melding"></a>
<div style="display: none;">
<div class="fancybox">
<div id="melding"><br />
<br />
<h3>Velkommen til min nye hjemmeside.</h3>
<br />
<p>Testing - Testing. </p>
</div>
</div>
</div>
Das Css im Stylesheet für den oberen Bildschirm:
.fancybox {
width: 600px;
padding-left: 30px;
padding-right: 30px;
padding-bottom: 20px;
padding-top: 30px;
}
#melding{
text-decoration:none;
}
#popup{
background-color:#444;
}
Egal, was ich versuche oder tue, ich erhalte das gleiche Quadrat ohne Polsterung zurück.