我有一个需要 twitterfeed 的项目。这通常适用于:
但是在这个项目上它加载然后立即消失。
HTML
<body>
<div class="gridContainer clearfix">
<div id="TopBanner"><div class="LogoContainer"><img src="../../img/LayoutImage/LogoDeWitteHoeveMonochroom.png"></div></div>
<div id="MainContent"><div class="ContentContainer"><h1>Social Media</h1><p>Natuurlijk kunt u de Witte Hoeve vinden op social media.</p>
<p>Volg de Witte Hoeve op sociale media voor het laatste nieuws, nieuwe evenementen en acties.</p><div class="SocialContent"><!--<div class="Twitter"><a href="http://www.twitter.com/wittehoeve"target="_blank"></a></div><div class="Facebook"><a href="http://www.facebook.com/De-Witte-Hoeve" target="_blank"></a></div><div class="LinkedIn"><a href="#" target="_blank"></a></div>-->
<div class="TwitterExp"><a class="twitter-timeline" href="https://twitter.com/ICUMediaNet" data-widget-id="356770132908994560">Tweets van @ICUMediaNet</a>
<script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
</div></div>
<div id="ImageSlider">
<div class="ImageSliderContainer">
<div class="Slider">
<ul class="rslides">
<li>
<img src="../../img/LayoutPhoto/DeWitteHoeveFront.jpg" />
<p class="flex-caption">Hét feest- en vergadercentrum in Venray.</p>
</li>
<li>
<img src="../../img/LayoutPhoto/FeestPubliek.jpg" />
<p class="flex-caption">Voor uw onvergetelijke feest.</p>
</li>
<li>
<img src="../../img/LayoutPhoto/KamerBed.jpg" />
<p class="flex-caption">Luxe Hotelkamers voor een gezonde nachtrust.</p>
</li>
</ul>
</div>
</div>
</div>
<div id="Menu">
<div class="menu-button">Menu</div>
<nav>
<ul data-breakpoint="768" class="flexnav">
<li><a href="../../" class="FirstLi"><span class="MenuIcon">⌂</span>Home</a></li>
<li><a class="SubMenu"><span class="MenuIcon">🛆</span>Hotel</a>
<ul>
<li><a href="../../hotel/booking/"><span class="MenuIcon">💳</span>Reserveren</a></li>
<li><a href=""><span class="MenuIcon">☽</span>Kamers</a></li>
<li><a href=""><span class="MenuIcon">ℹ</span>Algemene informatie</a></li>
</ul>
</li>
<li><a class="SubMenu"><span class="MenuIcon">📣</span>Evenementen</a>
<ul>
<li><a href=""><span class="MenuIcon">👥</span>Trouwen</a></li>
<li><a class="SubMenu"><span class="MenuIcon">📈</span>Bedrijfsfeesten</a>
<ul>
<li><a href=""><span class="MenuIcon"></span>Personeelsfeesten</a></li>
<li><a href=""><span class="MenuIcon">🔊</span>Productpresentaties</a></li>
</ul>
</li>
<li><a class="SubMenu"><span class="MenuIcon">📅</span>Agenda</a>
<ul>
<li><a href=""><span class="MenuIcon">♫</span>HoeveBlues</a></li>
<li><a href=""><span class="MenuIcon"></span>Paranormale Beurs</a></li>
<li><a href=""><span class="MenuIcon">♫</span>Dance Classics</a></li>
<li><a href=""><span class="MenuIcon">♫</span>Sixties Night</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="SubMenu"><span class="MenuIcon">🌄</span>Zalen</a>
<ul>
<li><a href=""><span class="MenuIcon">💼</span>Vergaderen</a></li>
<li><a href=""><span class="MenuIcon">📖</span>Seminars</a></li>
<li><a href=""><span class="MenuIcon">🎤</span>Conferenties</a></li>
</ul>
</li>
<li><a class="LastLi SubMenu"><span class="MenuIcon">📞</span>Contact</a>
<ul>
<li><a href="../info/"><span class="MenuIcon">✉</span>Contactgegevens</a></li>
<li><a href="#"><span class="MenuIcon"></span>Social Media</a></li>
<li><a href="../route/"><span class="MenuIcon"></span>Route</a></li>
</ul>
</li>
</ul>
</nav>
</div>
<div id="Footer">
<div id="FooterOne"><div class="FooterContent">Gasstraat 5<br>5801CT Venray<br>T: <a href="tel://+31-478-581626">0478-581626</a><br>F: <a href="tel://+31-478-511944">0478-511944</a><br>E: <a href="mailto:info@dewittehoeve.com">info@dewittehoeve.com</a></div></div>
<div id="FooterTwo"><span class="FooterSocialTwitter"><a href="http://twitter.com/wittehoeve" target="_blank"></a></span><span class="FooterSocialFacebook"><a href="http://www.facebook.com/De-Witte-Hoeve" target="_blank"></a></span><span class="FooterSocialLinkedin"><a href="#" target="_blank"></a></span></div>
<div id="FooterThree"><div class="Copyright">© 2013 de Witte Hoeve</div></div>
<p> </p></div>
</div>
<script src="../../Jscripts/respond.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="../../Jscripts/jquery.backstretch.js"></script>
<script src="../../Jscripts/responsiveslides.min.js"></script>
<script src="../../Jscripts/jquery.flexnav.js"></script>
<script type="text/javascript">
onresize=onload=function() {
if ($(window).width() < 1024) {
$("#MainContent").insertAfter($("#ImageSlider"));
$("#Menu").insertBefore($("#TopBanner"));
} else {
$("#MainContent").insertBefore($("#ImageSlider"));
$("#Menu").insertBefore($("#Footer"));
}
};
</script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".flexnav").flexNav();
});
</script>
<script type="text/javascript">
$(".rslides").responsiveSlides({
auto: true,
speed: 500,
timeout: 4000,
pager: false,
nav: false,
random: false,
pause: false,
pauseControls: false,
prevText: "Previous",
nextText: "Next",
maxwidth: "",
navContainer: "",
manualControls: "",
namespace: "rslides",
before: function(){},
after: function(){}
});
</script>
<script type="text/javascript">
$.backstretch([
"../../img/LayoutPhoto/KamerBackground.jpg"
, "../../img/LayoutPhoto/PoortBackground.jpg"
, "../../img/LayoutPhoto/GangBackground.jpg"
, "../../img/LayoutPhoto/ChampagneBackground.jpg"
], {duration: 4500, fade: 800});
</script>
</body>
CSS
.SocialContent {
display: block;
color: #222222;
background-color: #FFFFFF;
-khtml-border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.twitter-timeline {
display: block;
max-width: 100%;
}
有谁熟悉这个问题?
我发现破坏 twitterfeed 的脚本是:
<script type="text/javascript">
onresize=onload=function() {
if ($(window).width() < 1024) {
$("#MainContent").insertAfter($("#ImageSlider"));
$("#Menu").insertBefore($("#TopBanner"));
} else {
$("#MainContent").insertBefore($("#ImageSlider"));
$("#Menu").insertBefore($("#Footer"));
}
};
</script>
当然,这是我从头开始“完全”编写的唯一脚本。谁能看到我的错误?
编辑 I:我添加了 HTML 的其余部分 编辑 II:我确定了有问题的脚本,但仍然希望拥有它所具有的功能。