Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Original geschrieben von palvoelgyi

Hallo zusammen,

ich habe eine Webseite, wo ein Button drauf ist, der die JS Funktion Drucken aufruft.

Gibt es eine Möglichkeit mit HTML, CSS, .... diesen Buttons nicht mit auszudrucken?

Frank

Hi!

Du kannst die CSS Eigenschaft "visibility" des Buttons auf "hidden" stellen bevor du "window.print()" aufrufst

Gruß

Azrael

Original geschrieben von palvoelgyi

Kannste mir ein kleines Beispiel posten, wie die JS Funktion aussehen muss. Ich bekomme das nicht ganz hin.

Frank

Beispiel:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<TITLE>visibility</TITLE>

<SCRIPT type="text/javascript">

<!--

function druck() {

 if(document.getElementById) {

   document.getElementById("myButton").style.visibility = "hidden";

   window.print();

 }

}

//-->

</SCRIPT>

</HEAD>


<BODY>

<input type="button" onClick="druck()" name="test" id="myButton" value="bla">

</BODY>


</HTML>

Gruß

Azrael

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.