Im пытается показать этот div на главной странице, используя программное обеспечение для отслеживания проблем онлайн, которое позволяет настраивать. Но я могу использовать только JS и CSS. Как я могу установить div только для показа на example.com/homepage, а не на любой другой странице.Показать div только на домашней странице, используя только JS & CSS
---------------- ВОТ КОД -------------- JS:
$('#mainArea')
.before(
'<div id="vmenu"><table width=900><tr><td width=50% rowspan=2>Welcome to the Software Partner Portal. Click on “Case status” to see all your open cases, or “New case” to submit a new one.<br><br>The “Wiki” option is where you can find searchable reference material on a variety of topics from product documentation to release notes and even tips on IT issues.<br><br>If you need any help please contact us at <a href="mailto:[email protected]">[email protected]</a> or 514.335.5525.</td></tr></table></div>'
);
$('a.navlink[href*="default.asp?pre=preLogOff"]')
.attr('href', 'http://www.example.com/login.php')
$("table.biglist")
.find("tr")
.each(function() {
$(this)
.find("td:contains('Closed')")
.each(function() {
$(this)
.parent()
.hide();
});
});
CSS:
#mainArea, mainAreaContinued{
}
#idLinkToFogCreek {
display:none;
}
table#mainArea {
display:none;
}
#vmenu {
width:900px;
height:auto;
margin:0 auto;
background-color: #E0E9F1;
border: 2px solid #B1C9DD;
font-family: 'Cambria',Georgia,'Times New Roman',Times,serif;
}
#vmenu ul {
list-style:none;
margin:0px;
padding:5px;
}
#vmenu a {
text-decoration:none;
font-size:12px;
}
#vmenu h4 {
color:black;
width:100%;
font-weight:bold;
border-bottom:solid 2px #f0f0f0;
margin:0;
}
#vmenu a:hover {
text-decoration:underline;
}
#vmenu li {
margin-bottom:2px;
}
бы я обернуть что вокруг моего текущего JS? im, не владеющий js, вы можете показать мне, что нужно добавить его –
Да, где «// Показать div» есть, вы должны добавить свой код, который отображает div. – taxicala