Author Topic: CSS - Frage zu Hover Effect ??  (Read 17430 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
CSS - Frage zu Hover Effect ??
« on: April 06, 2005, 11:35:44 AM »
Hallo liebes Forum  :D

Wie passe ich bitte dieses CSS so an das ich bei überfahren der Felder der Maus eine andere Farbe bekomme  :?: :?:

Code: [Select]
/*--Images----------------------------------------------------*/
.imagerow1 {
 background-color: #659FD4;
 color: #000000;
}

.imagerow2 {
 background-color: #A4C8E9;
 color: #000000;
}

Vielen Dank für eure Hilfe :lol: :lol:

Gr. Sabrina

Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: CSS - Frage zu Hover Effect ??
« Reply #1 on: April 06, 2005, 12:21:04 PM »
Hallo liebes Forum  :D

Wie passe ich bitte dieses CSS so an das ich bei überfahren der Felder der Maus eine andere Farbe bekomme  :?: :?:

Code: [Select]
/*--Images----------------------------------------------------*/
.imagerow1 {
 background-color: #659FD4;
 color: #000000;
}

.imagerow2 {
 background-color: #A4C8E9;
 color: #000000;
}

Hier ein Demo : http://www.7dana.com/4images/

Vielen Dank für eure Hilfe :lol: :lol:

Gr. Sabrina

Offline Jo

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Jo´s Homepage
Re: CSS - Frage zu Hover Effect ??
« Reply #2 on: April 06, 2005, 02:39:10 PM »
Schau mal in den Quelltext :wink: :
Code: [Select]
<td align="center" class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'">
Du musst 2 neue Klassen in CSS anlegen. In diesem Fall "thumb" und "thumb2".


Gruß,
Jo.




Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: CSS - Frage zu Hover Effect ??
« Reply #3 on: April 06, 2005, 04:56:44 PM »
Schau mal in den Quelltext :wink: :
Code: [Select]
<td align="center" class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'">
Du musst 2 neue Klassen in CSS anlegen. In diesem Fall "thumb" und "thumb2".


Gruß,
Jo.


Hallo Jo :-)

Wo und in welches HTML Template bitte muss ich das einsetzten ??

Code: [Select]
<td align="center" class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'">

Danke :-)

Liebe Grüße Sabrina :-)




Offline Jo

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Jo´s Homepage
Re: CSS - Frage zu Hover Effect ??
« Reply #4 on: April 06, 2005, 06:02:44 PM »
Gute Frage!  8O

Also ich würde sagen, mindestens in der
categories.html
home.html

Ich würde es erst mal bei diesen beiden ändern, dann mal die Bildergalerie durchklicken.
Vielleicht fällt Di dann noch an anderer Stelle auf, dass Du es dort einbauen möchtest.
Musst halt dann danach suchen.  :roll:

Viel Spaß dabei!

Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: CSS - Frage zu Hover Effect ??
« Reply #5 on: April 06, 2005, 06:25:25 PM »
Hallo Jo

Vielleicht habe ich mich ein wenig undeutlich ausgedrückt  :oops: :oops:

Ich meinte wo genau muss ich das hier in der home.html einbauen ?? :

Code: [Select]
<td align="center" class="thumb" onmouseover="this.className='thumb2'" onmouseout="this.className='thumb'">


liebe Gr. Sabrina

Offline Jo

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Jo´s Homepage
Re: CSS - Frage zu Hover Effect ??
« Reply #6 on: April 06, 2005, 06:32:07 PM »
Schau Dir doch einfach den Quelltext von http://www.7dana.com/4images/ an.

Ich habe das Template 7dana nicht und kann Dir jetzt leider nicht sagen: "In Zeile XX musst Du das und das ändern".
Aber mit ein wenig Ausprobieren bekommst Du das auch hin, da bin ich mir sicher!
Mache aber bitte von Deinen Templates in jetzigem Zustand unbedingt ein Backup!!!!
Falls Du Dir die Templates völlig zerschießt, bekommst Du wenigstens den Ur-Zustand zurück.

Verrätst Du uns den mal die URL Deiner Galerie?


Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: CSS - Frage zu Hover Effect ??
« Reply #7 on: April 06, 2005, 08:48:43 PM »
So pauschal ist das idT nicht zu sagen. Und so einfach ist es auch, beispielhaft (Version 1.7) kann ich es mal aufzeigen:

Das setzt voraus, dass eine css-Klasse imagerow1hover angelegt wurde (kopiere die von imagerow1, setze es darunter, in imagerow1hover umbenennen und Farbe entsprechend ändern). Dateien vorher natürlich sicher, ist klar, ne ;)

categories.php -> Anzeige bei ...categories.php?cat_id=XX

SUCHE
Code: [Select]
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
Ersetze mit
Code: [Select]
$thumbnails .= "<tr>\n";
    }
    $thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\" class=\"imagerow".$row_bg_number."\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow".$row_bg_number."'\">\n";

SUCHE
Code: [Select]
$thumbnails .= "<td width=\"".$imgtable_width."\" >\n&nbsp;\n</td>\n";Ersetze mit
Code: [Select]
$thumbnails .= "<td width=\"".$imgtable_width."\" class=\"imagerow".$row_bg_number."\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow".$row_bg_number."'\">\n&nbsp;\n</td>\n";

index.php -> Für Startseite

SUCHE
Code: [Select]
$new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";Ersetze mit
Code: [Select]
$new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr><td class=\"imagerow1\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow1'\">";
SUCHE Funktion
Code: [Select]
if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

Ersetze mit
Code: [Select]
if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $new_images .= "<tr>\n";
    }
    $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\" class=\"imagerow".$row_bg_number."\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow".$row_bg_number."'\">\n";

Bei mir hat es nun so geklappt

Viel Spaß ;)
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline Jo

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Jo´s Homepage
Re: CSS - Frage zu Hover Effect ??
« Reply #8 on: April 06, 2005, 08:56:08 PM »
Ist es denn nicht sinnvoller die eigentlichen Template-Dateien zu ändern?
Du hast ja jetzt - wenn auch erfolgreich - die php-Dateien geändert.
Wenn man aber nun die Galerie auf ein anderes Template umstellen will, welches dann noch auf andere CSS-Datei zugreift, dürfte es doch zu Problemen kommen, oder?

Oder liege ich jetzt völlig falsch?

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: CSS - Frage zu Hover Effect ??
« Reply #9 on: April 06, 2005, 09:09:29 PM »
Dann müsste lediglich die zum templatepack zugehörige css Datei um die imagerow1hover erweitert werden.
Der Quelltext, welchen es für gewünschte Änderung zu ändern gilt steht nun mal in den php-Dateien. in den entspr. templates wird lediglich zB {thumbnails} aufgerufen und somit auch die TAGs aus der php Datei. Hat mich auch gewundert
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline Jo

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Jo´s Homepage
Re: CSS - Frage zu Hover Effect ??
« Reply #10 on: April 06, 2005, 09:18:22 PM »
Hast Recht!
Habe gerade in meinem Template (4yellow_orange) nachgeschaut.
Es sind die PHP-Dateien, die dazu bearbeitet werden müssen.

Also sorry Sabrina:
Hör auf RoadDogg!  :D

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: CSS - Frage zu Hover Effect ??
« Reply #11 on: April 06, 2005, 09:30:17 PM »
...
Hör auf RoadDogg!  :D

Danke  :mrgreen:
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: CSS - Frage zu Hover Effect ??
« Reply #12 on: April 07, 2005, 06:28:49 PM »
So pauschal ist das idT nicht zu sagen. Und so einfach ist es auch, beispielhaft (Version 1.7) kann ich es mal aufzeigen:

Das setzt voraus, dass eine css-Klasse imagerow1hover angelegt wurde (kopiere die von imagerow1, setze es darunter, in imagerow1hover umbenennen und Farbe entsprechend ändern). Dateien vorher natürlich sicher, ist klar, ne ;)

categories.php -> Anzeige bei ...categories.php?cat_id=XX

SUCHE
Code: [Select]
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
 }
 $thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
Ersetze mit
Code: [Select]
$thumbnails .= "<tr>\n";
 }
 $thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\" class=\"imagerow".$row_bg_number."\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow".$row_bg_number."'\">\n";

SUCHE
Code: [Select]
$thumbnails .= "<td width=\"".$imgtable_width."\" >\n \n</td>\n";Ersetze mit
Code: [Select]
$thumbnails .= "<td width=\"".$imgtable_width."\" class=\"imagerow".$row_bg_number."\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow".$row_bg_number."'\">\n \n</td>\n";

index.php -> Für Startseite

SUCHE
Code: [Select]
$new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";Ersetze mit
Code: [Select]
$new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr><td class=\"imagerow1\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow1'\">";
SUCHE Funktion
Code: [Select]
if ($count == 0) {
 $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
 $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
 }
 $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

Ersetze mit
Code: [Select]
if ($count == 0) {
 $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
 $new_images .= "<tr>\n";
 }
 $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\" class=\"imagerow".$row_bg_number."\" onmouseover=\"this.className='imagerow1hover'\" onmouseout=\"this.className='imagerow".$row_bg_number."'\">\n";

Bei mir hat es nun so geklappt

Viel Spaß ;)

Hallo :-)

Vielen Dank für den Code - nur leider funzt dieser nicht bei mir  :cry: :cry: :cry:

Bekomme folgende Fehlermeldung :


Code: [Select]
Parse error: parse error, unexpected T_STRING in /homepages/28/d36282853/htdocs/Galerie/includes/template.php(133) : eval()'d code on line 1063
Vielleicht weist du wo der Wurm drin ist  :? :?

Danke Sabrina  :lol: :lol:

Offline Jo

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • Jo´s Homepage
Re: CSS - Frage zu Hover Effect ??
« Reply #13 on: April 07, 2005, 06:57:24 PM »
Hi Sabrina,
poste mal Deinen geänderten Code con Zeile 1060 bis 1070.

Scheint ein Fehler wegen " oder ' zu sein-

Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: CSS - Frage zu Hover Effect ??
« Reply #14 on: April 07, 2005, 07:05:07 PM »
Hi Sabrina,
poste mal Deinen geänderten Code con Zeile 1060 bis 1070.

Scheint ein Fehler wegen " oder ' zu sein-

Hey Jo :-)

Ist nur komisch, das meine temlate.php nur 198 Zeilen hat  :?: :?: . Sprich ne Zeile 1063 gibt es gar nicht  :?

Gr. Sabrina  :P


Aber hier mal der Code der template.php :

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: template.php                                         *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

class 
Template {
  
  
var $no_error 0;
  var $key_cache = array();
  var $val_cache = array();
  var $template_cache = array();
  var $template_path;
  var $template_extension "html";
  var $start "{";
  var $end "}";

  function Template($template_path "") {
    if (!@is_dir($template_path)) {
      $this->error("Couldn't open Template-Pack ".$template_path1);
    }
    $this->template_path $template_path;
  }

  function set_identifiers($start$end){
    $this->start $start;
    $this->end $end;
  }

  function register_vars($var_name$value "") {
    if (!is_array($var_name)) {
      if (!empty($var_name)) {
        $value preg_replace(array('/\$([0-9])/''/\\\\([0-9])/'), array('&#36;\1''&#92;\1'), $value);
        $this->key_cache[$var_name] = "/".$this->add_identifiers($var_name)."/";
        $this->val_cache[$var_name] = $value;
      }
    }
    else {
      foreach ($var_name as $key => $val) {
        if (!empty($key)) {
          $val preg_replace(array('/\$([0-9])/''/\\\\([0-9])/'), array('&#36;\1''&#92;\1'), $val);
          $this->key_cache[$key] = "/".$this->add_identifiers($key)."/";
          $this->val_cache[$key] = $val;
        }
      }
    }
    return;
  }

  function un_register_vars($var_list) {
    $vars explode(","$var_list);
    foreach ($vars as $key => $val) {
      unset($this->key_cache[$val]);
      unset($this->val_cache[$val]);
    }
    return;
  }

  function add_identifiers($var_name) {
    return preg_quote($this->start.$var_name.$this->end);
  }

  function cache_templates($template_list) {
    $template_list explode(","$template_list);
    foreach ($template_list as $val) {
      if (!isset($this->template_cache[$val])) {
        $this->template_cache[$val] = $this->get_template($val);
      }
    }
  }

  function get_template($template) {
    if (!isset($this->template_cache[$template])) {
      $path $this->template_path."/".$template.".".$this->template_extension;
      $line = @implode("", @file($path));
      if (empty($line)) {
        $this->error("Couldn't open Template ".$path1);
      }
      $this->template_cache[$template] = $line;
    }
    return $this->template_cache[$template];
  }

  function replace_if($template) {
    foreach ($this->key_cache as $key => $val) {
      if (empty($this->val_cache[$key]) || $this->val_cache[$key] == REPLACE_EMPTY) {
        $reg "/".$this->start."if[ \t\r\n]+".$key.$this->end."(.*)".$this->start."endif[ \t\r\n]+".$key.$this->end."/siU";
        $template preg_replace($reg""$template);
      }
    }
    return $template;
  }

  function parse_template($template_name) {
    $template $this->get_template($template_name);
    $template $this->replace_if ($template);
    $template preg_replace($this->key_cache$this->val_cache$template);
    return $template;
  }

  function parse_array($array) {
    foreach ($array as $key => $val) {
      $array[$key] = (is_array($val)) ? $this->parse_array($val) : preg_replace($this->key_cache$this->val_cache$val);
    }
    return $array;
  }

  function print_template($template) {
    $template $this->clean_template($template);
    if (EXEC_PHP_CODE) {
      $code $this->exec_php_code($template);
      eval($code);
    }
    else {
      $code preg_replace("/<\[\?|%](php|=)+( \r\n)*(.*)[\?|%]>/siU"""$template);
      echo $code;
    }
  }

  function exec_php_code($code) {
    $code str_replace('\\''\\\\'$code);
    $code str_replace('\'''\\\''$code);
    $new_lines = array();
    $is_code 0;
    $lines explode("\n"$code);
    foreach ($lines as $line) {
      //$line = trim($line);
      if (preg_match('/<[\?|%](php|=)+/'$line$regs)) {
        $line preg_replace('/<[\?|%](php|=)?/i'''$line);
        $line = ((!empty($regs[1]) && $regs[1] == "=") ? "echo " "").$line;
        $is_code 1;
      }
      if ($is_code) {
        $line str_replace ('\\\'''\''$line);
        $line str_replace ('\\\\''\\'$line);
        if (preg_match('/[\?|%]>/'$line)) {
          $line preg_replace('/[\?|%]>/'''$line);
          $is_code 0;
        }
      }
      else {
        $line 'echo \''.$line.'\'."\\n";';
      }
      $new_lines[] = $line;
    }
    return implode("\n"$new_lines);
  }

  function clean_template($template) {
    $search_array = array(
      "/".$this->start."[^ \t\r\n".$this->end."]+".$this->end."/",
      "/".$this->start."if[ \t\r\n]+[^ \t\r\n".$this->end."]+".$this->end."/",
      "/".$this->start."endif[ \t\r\n]+[^ \t\r\n".$this->end."]+".$this->end."/",
      "/&#36;([0-9])/",
      "/&#92;([0-9])/"
    );
    $replace_array = array(
      "",
      "",
      "",
      '$\1',
      '\\\1'
    );
    $template preg_replace($search_array$replace_array$template);
    return $template;
  }

  function error($errmsg$halt 0) {
    if (!$this->no_error) {
      echo "<br /><font color='#FF0000'><b>Template Error</b></font>: ".$errmsg."<br />";
      if ($halt) {
        exit;
      }
    }
  }
// end of class
?>