Pb Onglets + Frames

venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention   -  
venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour à tous,

voilà, j'ai fait une page html pour créer des onglets, tout fonctionne bien.
Quand je clique sur un onglet, il change de couleur, etc...
Mais quand je l'inclus dans une frame, les onglets ne changent pas de couleur.

Comment faire pour que malgé la frame cela fonctionne toujours ?

Ps voila mon URL quand tout fonctionne bien.
http://127.0.0.1/test_tab2.php#tabview=tab0

Configuration: Windows XP
Internet Explorer 7.0

6 réponses

cheese42 Messages postés 860 Date d'inscription   Statut Membre Dernière intervention   120
 
slt, bon deja ton url ne sert pas a grand chose pour les autres personnes !!! lol!!!
0
cheese42 Messages postés 860 Date d'inscription   Statut Membre Dernière intervention   120
 
ensuite tu as peut etre mis ton css dans une feuille de style, si cest ca, tu peux mettre ton html pour que lon voie ??
0
venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention  
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Menu Onglet Console Capplan</title>

<style type="text/css">
/*margin and padding on body element
  can introduce errors in determining
  element position and are not recommended;
  we turn them off as a foundation for YUI
  CSS treatments. */
body {
	margin:0;
	padding:0;
}
</style>

<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/tabview/assets/skins/sam/tabview.css" />
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/element/element-beta-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/tabview/tabview-min.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/history/history-min.js"></script>

<!--there is no custom header content for this example-->

</head>

<body class=" yui-skin-sam">

<!-- titre -->
<!--<div class="exampleIntro">
	<p>
  This example demonstrates how to use the Browser History Manager
  to remember which tabs have been visited with the TabView widget
  and dynamically update it when the user presses the browser's
  back/forward buttons.
</p>
			
</div> -->

<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->

<style>

#yui-history-iframe {
  position:absolute;
  top:0; left:0;
  width:1px; height:1px; /* avoid scrollbars */
  visibility:hidden;
}

#demo { margin-bottom:1em; }

</style>

<!-- Static markup required for browser history management. Note that these
     could be created using document.write in a script block. But they have
     to be created while the page is being parsed, so it cannot be done
     from an imported script file. Also, these have to be created as early
     as possible to avoid problems on Internet Explorer.
     Note that "magic URLs" such as:

         javascript:document.open();document.write(new Date().getTime());document.close();

     and such do NOT work on IE6! Only a real document works (that "real
     document" does not need to be an HTML document. It can be an image
     as well. Using an asset that you use somewhere else on your site,
     instead of a separate asset avoids an unnecessary server round trip.
     Finally, note that the iframe is only used on Internet Explorer.
     If this page is server generated (by a PHP script for example), it is
     a good idea to create the IFrame ONLY for Internet Explorer (use
     server side user agent sniffing) -->

<iframe id="yui-history-iframe" src="assets/blank.html"></iframe>
<input id="yui-history-field" type="hidden">

<!-- Static markup required for the TabView widget. -->

 <!-- <div id="header" class="yui-navset yui-navset-top">
  <ul class="yui-nav">
    <li><a href="https://www.google.com/?gws_rd=ssl" TARGET="capplan"><em>RFO Prod</em></a></li>
    <li title="active" class="selected"><a href="http://capplan.srv.in.karavel.com:8080/karavelfront.htm" TARGET="capplan"><em>KIS 1 Prod</em></a></li>
    <li title="" class=""><a href="http://capplan.srv.in.karavel.com:8082/KaravelFrontqualif.htm" TARGET="capplan"><em>Kis 1 Qualif</em></a></li>
	<li title="" class=""><a href="http://capplan.srv.in.karavel.com:8082/KaravelFrontdev.htm" TARGET="capplan"><em>Kis 1 DEV</em></a></li>
	<li title="" class=""><a href="http://10.12.0.87/mel.php" TARGET="capplan"><em>Suivi des MELs</em></a></li>
  </ul> -->
  
<div id="demo" class="yui-navset yui-navset-top">
  <ul class="yui-nav">
    <li><a href="#tab1"><em>Tab One Label</em></a></li>
    <li title="active" class="selected"><a href="#tab2"><em>Tab Two Label</em></a></li>
    <li title="" class=""><a href="#tab3"><em>Tab Three Label</em></a></li>
  </ul>
--<div class="yui-content">
    <div style="display: none;" id="tab1"><p>Google</p><a href="https://www.google.com/?gws_rd=ssl"></div>
    <div style="display: block;" id="tab2"><p>Tab Two Content</p></div>
    <div style="display: none;" id="tab3"><p>Tab Three Content</p></div>
  </div>
</div>

<script>

(function () {

    // The initially selected tab will be chosen in the following order:
    //
    // URL fragment identifier (it will be there if the user previously
    // bookmarked the application in a specific state)
    //
    //         or
    //
    // "tab0" (default)

    var bookmarkedTabViewState = YAHOO.util.History.getBookmarkedState("tabview");
    var initialTabViewState = bookmarkedTabViewState || "tab0";

    var tabView;

    // Register our TabView module. Module registration MUST
    // take place before calling YAHOO.util.History.initialize.
    YAHOO.util.History.register("tabview", initialTabViewState, function (state) {
        // This is called after calling YAHOO.util.History.navigate, or after the user
        // has trigerred the back/forward button. We cannot discrminate between
        // these two situations.

        // "state" can be "tab0", "tab1" or "tab2".
        // Select the right tab:
        tabView.set("activeIndex", state.substr(3));
    });

    function handleTabViewActiveTabChange (e) {
        var newState, currentState;

        newState = "tab" + this.getTabIndex(e.newValue);

        try {
            currentState = YAHOO.util.History.getCurrentState("tabview");
            // The following test is crucial. Otherwise, we end up circling forever.
            // Indeed, YAHOO.util.History.navigate will call the module onStateChange
            // callback, which will call tabView.set, which will call this handler
            // and it keeps going from here...
            if (newState != currentState) {
                YAHOO.util.History.navigate("tabview", newState);
            }
        } catch (e) {
            tabView.set("activeIndex", newState.substr(3));
        }
    }

    function initTabView () {
        // Instantiate the TabView control...
        tabView = new YAHOO.widget.TabView("demo");
        tabView.addListener("activeTabChange", handleTabViewActiveTabChange);
    }

    // Use the Browser History Manager onReady method to instantiate the TabView widget.
    YAHOO.util.History.onReady(function () {
        var currentState;

        initTabView();

        // This is the tricky part... The onLoad event is fired when the user
        // comes back to the page using the back button. In this case, the
        // actual tab that needs to be selected corresponds to the last tab
        // selected before leaving the page, and not the initially selected tab.
        // This can be retrieved using getCurrentState:
        currentState = YAHOO.util.History.getCurrentState("tabview");
        tabView.set("activeIndex", currentState.substr(3));
    });

    // Initialize the browser history management library.
    try {
        YAHOO.util.History.initialize("yui-history-field", "yui-history-iframe");
    } catch (e) {
        // The only exception that gets thrown here is when the browser is
        // not supported (Opera, or not A-grade) Degrade gracefully.
        initTabView();
    }

})();

</script>

<!--END SOURCE CODE FOR EXAMPLE =============================== -->
0
cheese42 Messages postés 860 Date d'inscription   Statut Membre Dernière intervention   120
 
desole jai mis longtemps car en collant ton code il y avait des /> qui sont pas passes et ca marchait pas !!! mais la c'est bon
je viens de la tester en local mais je vois pas le probleme car ta frame est cachée et en fait les onglets changent bien de couleurs les liens sont bons mais la frame te sert pour faire quoi en fait ? garder un historique?
0
venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention  
 
oui c'est pour l'historique.

Effectivement sous cette forme ça fonctionne bien,
Mais je parlais de mettre le code dans une frame appelé "menu" et en cliquant sur un onglet faire apparaitre le contenu d'une page dans une autre frame : "bas".

du coup ça fait 3 fichiers : frame0.htm, menu.htm, bas.htm (menu.htm étant le fichier que j'ai collé plus haut)
0
cheese42 Messages postés 860 Date d'inscription   Statut Membre Dernière intervention   120
 
donc, resumons, page index avec au centre donc ta page en haut le menu.html et en bas du site bas.html....
toi ce que tu recherches donc c'est comment faire pour qu'en cliquant sur frame menu, ca change quelquechose dans bas.html , c'est bien ca ??? donc tu recherches comment faire pour que 2 frames soient ""connectées"" ensemble !!!
0
venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention  
 
heu, je suis un peu boulet, mais ça je crois que je sais faire,
le truc c'est que dès que je met le menu dans la frame du haut, les onglets ne changent plus de couleurs
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cheese42 Messages postés 860 Date d'inscription   Statut Membre Dernière intervention   120
 
attends je pense que si sebsauvage ( contributeur,modérateur) passe par la, la solution ne sera pas tres loin !!!!!!(je lui ai fais passer le message, patientons !!!)
0
venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention  
 
ok,
patience
0
sebsauvage Messages postés 32893 Date d'inscription   Statut Modérateur Dernière intervention   15 662
 
Désolé je n'ai jamais exploré l'API Yahoo, et je ne peux pas prédire le comportement des onglets avec les tonnes de Javascript de chez Yahoo.
0
venhom666 Messages postés 12 Date d'inscription   Statut Membre Dernière intervention  
 
oki, je vais refaire a l'ancienne,
mais je sais que j'avais déjà, le même problème avec des onglets traditionnels
0