Webboard

Pełna wersja: Dodanie Slideru na stronie głównej
Aktualnie przeglądasz uproszczoną wersję forum. Kliknij tutaj, by zobaczyć wersję z pełnym formatowaniem.
Stron: 1 2 3
ja na js sie wgl nei znam, wiec naprawde prosze o wyrozumialosc, jak nazwac plik ktory zapodales w linku, i rozumiem ze on trafia do ftp do katalogu js, ale jak zrobic odnosnik do niego?
Nazwać jak chcesz, potem tylko w szablonie headerinclude:
Kod:
<script type="text/javascript" src="ścieżka do pliku"></script>
dalej jest problem ;/
zrobiłem wszystko jak trzeba...
W headerinclude dodane to co trzeba i tez do tego pliku ktorego nazwalem slider.js ...

[Obrazek: sxGg.png]
W takim razie podaj tutaj zawartość tego Twojego headerinclude.
Oto on:
Kod:
<script type="text/javascript" src="js/slider.js"></script>
<script type="text/javascript" charset="utf-8">
     $(function(){
         $('#loopedSlider').loopedSlider({
             autoStart: 3500,
             restart: 15000
         });
         $('#newsSlider').loopedSlider({
             autoHeight: 400
         });
     });
</script>
    






<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<link href='//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,200italic,400italic,600italic' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1800"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1800"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1800"></script>
<script type="text/javascript" src="images/vienna/jquery-ui.js"></script>
<script type="text/javascript" src="images/vienna/jquery.tipsy.js"></script>
<script type="text/javascript" src="images/vienna/jquery.cookie.js"></script>


<script type='text/javascript'>
jQuery(function() {
jQuery("a").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("title").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("img").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("i").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("span").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("div").tipsy({gravity: jQuery.fn.tipsy.autoNS});
  });
</script>

{$stylesheets}
<script type="text/javascript">
<!--
    lang.unknown_error = "{$lang->unknown_error}";

    lang.select2_match = "{$lang->select2_match}";
    lang.select2_matches = "{$lang->select2_matches}";
    lang.select2_nomatches = "{$lang->select2_nomatches}";
    lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
    lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
    lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
    lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
    lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
    lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
    lang.select2_loadmore = "{$lang->select2_loadmore}";
    lang.select2_searching = "{$lang->select2_searching}";

    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var rootpath = "{$mybb->settings['bburl']}";
    var imagepath = "{$theme['imgdir']}";
      var yes_confirm = "{$lang->yes}";
    var no_confirm = "{$lang->no}";
    var MyBBEditor = null;
    var spinner_image = "{$theme['imgdir']}/spinner.gif";
    var spinner = "<img src='" + spinner_image +"' alt='' />";
// -->
</script>
W MyBB 1.8 nie ma konieczności ładowania dodatkowych bibliotek jQuery:
Kod:
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<link href='//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,200​italic,400italic,600italic' rel='stylesheet' type='text/css'>
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1800"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1800"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1800"></script>
<script type="text/javascript" src="images/vienna/jquery-ui.js"></script>
<script type="text/javascript" src="images/vienna/jquery.tipsy.js"></script>
<script type="text/javascript" src="images/vienna/jquery.cookie.js"></script>


<script type='text/javascript'>
jQuery(function() {
jQuery("a").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("title").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("img").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("i").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("span").tipsy({gravity: jQuery.fn.tipsy.autoNS});
jQuery("div").tipsy({gravity: jQuery.fn.tipsy.autoNS});
  });
</script>
<script type="text/javascript" src="js/slider.js"></script>
<script type="text/javascript" charset="utf-8">
     $(function(){
         $('#loopedSlider').loopedSlider({
             autoStart: 3500,
             restart: 15000
         });
         $('#newsSlider').loopedSlider({
             autoHeight: 400
         });
     });
</script>
{$stylesheets}
<script type="text/javascript">
<!--
    lang.unknown_error = "{$lang->unknown_error}";

    lang.select2_match = "{$lang->select2_match}";
    lang.select2_matches = "{$lang->select2_matches}";
    lang.select2_nomatches = "{$lang->select2_nomatches}";
    lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
    lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
    lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
    lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
    lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
    lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
    lang.select2_loadmore = "{$lang->select2_loadmore}";
    lang.select2_searching = "{$lang->select2_searching}";

    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var rootpath = "{$mybb->settings['bburl']}";
    var imagepath = "{$theme['imgdir']}";
      var yes_confirm = "{$lang->yes}";
    var no_confirm = "{$lang->no}";
    var MyBBEditor = null;
    var spinner_image = "{$theme['imgdir']}/spinner.gif";
    var spinner = "<img src='" + spinner_image +"' alt='' />";
// -->
</script>
Bez zmian, wygląda jak na poprzednim screenie.
Z pliku slider.js usuń:
Kod:
</script>






<script type="text/javascript">
i na końcu gdzieś jeszcze </script>.
Tak ma to wyglądać?
http://wklej.to/jLiyj
Na końcu jeszcze usuń </script>.
Progres ;)
Teraz wygląda to tak:
[Obrazek: XDGg.png]

Naprzemiennie z tym:
[Obrazek: sxGg.png]
Ustaw to na forum do czasu aż ja (czy ktokolwiek inny stąd udzielający pomocy) udzielę odpowiedź, tak to trudno stwierdzić, ale strzelając to nie ma CSS.
Musiałem wrócić do headerinclude z drugiego postu, przez zmiany wprowadzone w twoim headerinclude nie działał mi DVZ_Shoutbox(nie wyświetlał wiadomości itp). Już ustawiłem. Css dodane jest od początku.
Spróbuj utworzyć "slider.css" w Twoim stylu, a w jego zawartość:
Kod:
/*          * Required          */         .container { width:500px; height:375px; overflow:hidden; position:relative; cursor:pointer; }         .slides { position:absolute; top:0; left:0; }         .slides div { position:absolute; top:0; width:500px; display:none; }         /*          * Optional         */                  :focus { outline: 0; }         ins { text-decoration: none; }         del { text-decoration: line-through; }         table { border-collapse: collapse; border-spacing: 0; }         #loopedSlider { margin:18px auto; width:500px; position:relative; clear:both; }         ul.pagination { list-style-type:none; margin:0; padding:0; margin:9px auto; width:90px; }         ul.pagination li { float:left; margin:0 5px; }             ul.pagination a { display:block; width:12px; padding-top:12px; height:0; overflow:hidden; background-image:url(https://www.jboss.org/dms/testimages/images/pagination.png); background-position:0 0; background-repeat:no-repeat;}         ul.pagination li.active a {background-position:0 -12px}         a.previous { position:absolute; top:200px; left:-32px; }         a.next { position:absolute; top:200px; right:-32px; }
progres ale to dalej nie to...
Stron: 1 2 3